nave@lemmy.zipdeleted by creator to Lemmy Shitpost@lemmy.worldEnglish · 3 年前I wishi.imgur.comimagemessage-square187linkfedilinkarrow-up1928arrow-down117
arrow-up1911arrow-down1imageI wishi.imgur.comnave@lemmy.zipdeleted by creator to Lemmy Shitpost@lemmy.worldEnglish · 3 年前message-square187linkfedilink
minus-squaremryessirdeleted by creatorlinkfedilinkarrow-up4·3 年前Please elaborate. When and why would his suggestion be worse?
minus-squaremellejwz@lemmy.worldlinkfedilinkEnglisharrow-up1arrow-down2·3 年前It will check all of the if statements instead of stopping at the first match.
minus-squaremellejwz@lemmy.worldlinkfedilinkEnglisharrow-up2·3 年前My bad, I looked over the returns. If you return something there wouldn’t be much difference between both.
minus-squareCosmicomical@lemmy.worldlinkfedilinkarrow-up1·3 年前Ok just to clarify this was a joke. It was just a pedantic improvement on a deranged solution. The only sensible way to do this is with % 2 or with bitwise operations imo.
minus-squareValmond@lemmy.mindoki.comlinkfedilinkarrow-up1·3 年前Yeah gotta store the return value in a variable!
Please elaborate. When and why would his suggestion be worse?
It will check all of the if statements instead of stopping at the first match.
Each clause already returns
My bad, I looked over the returns. If you return something there wouldn’t be much difference between both.
Ok just to clarify this was a joke. It was just a pedantic improvement on a deranged solution. The only sensible way to do this is with % 2 or with bitwise operations imo.
Yeah gotta store the return value in a variable!