Equal (integer) sometimes doesn't work

Pure functions - those without execute wire going in and out, getting evaluated every time when their output used.

there are switch on int, which you might want to use for your case; also there are switch on pretty much all basic data types, as well as select.