shift assignment and comparison into one statement