nave to Lemmy Shitpost@lemmy.worldEnglish · 1 year agoI wishi.imgur.comexternal-linkmessage-square189fedilinkarrow-up1928arrow-down117
arrow-up1911arrow-down1external-linkI wishi.imgur.comnave to Lemmy Shitpost@lemmy.worldEnglish · 1 year agomessage-square189fedilink
minus-squarenyoooom@lemmy.worldlinkfedilinkarrow-up35·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.