nave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 1 year agoI wishi.imgur.comimagemessage-square158fedilinkarrow-up1786arrow-down113
arrow-up1773arrow-down1imageI wishi.imgur.comnave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 1 year agomessage-square158fedilink
minus-squarenyoooom@lemmy.worldlinkfedilinkarrow-up27·1 year agobool isEven(int num) { return num == 0 || !isEven(num - (num > 0 ? 1 : -1)); }
bool isEven(int num) { return num == 0 || !isEven(num - (num > 0 ? 1 : -1)); }
Damn that’s some solid optimization.