Chris is right on the money.

You could simplify this even more with PORTA.0 = PORTB.0 and drop the IF
statement altogether.