Remove repeated conditional test