Simplify condition

Remove double line and merge three if/else statements into one.

No functional change.