Use if instead of && for assignment

It's more clearly to use if instead of && for assignment.