Comment on I wish
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!
mellejwz@lemmy.world 8 months ago
It will check all of the if statements instead of stopping at the first match.
mryessir@lemmy.sdf.org 8 months ago
Each clause already returns
mellejwz@lemmy.world 8 months ago
My bad, I looked over the returns. If you return something there wouldn’t be much difference between both.
Cosmicomical@lemmy.world 7 months ago
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.
Valmond@lemmy.mindoki.com 8 months ago
Yeah gotta store the return value in a variable!