PreviousNext
== 1 is more efficient than != 1
Help > Appendix > Code Optimization > == 1 is more efficient than != 1

FLASH-                        RAM                Speed+

 

A test == 1 is more efficient (DECFSZ) than a test != 1.

 

if ( var1 != 1 )

  nop2();

else

  nop();

if ( var1 == 1 )

  nop();

else

  nop2();