modify nested if

I think this if  can merge into one line