5 ms·
> Really, think about it. How often do you see somebody inexperienced use ifs instead of a switch? This pattern is common enough for most compilers to recognize
by juxhindb 1y ago
> Really, think about it. How often do you see somebody inexperienced use ifs instead of a switch? This pattern is common enough for most compilers to recognize, and more importantly, optimize it.
This made me chuckle. Playing dumb so that gcc optimizes you away is both hilarious and genius
- 1718627440 1y agoActually the compiler converts the switch to ifs not the other way around.