nave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 1 year agoI wishi.imgur.comimagemessage-square90fedilinkarrow-up1507arrow-down14
arrow-up1503arrow-down1imageI wishi.imgur.comnave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 1 year agomessage-square90fedilink
minus-squareCosmicomical@lemmy.worldlinkfedilinkarrow-up7·1 year agoThere is a simpler way: all the "else if"s can be replaced with simple "if"s
minus-squareValmond@lemmy.mindoki.comlinkfedilinkarrow-up1arrow-down3·1 year agoYou mean make it even worse.(performance wise)? Interesting.
minus-squaremryessir@lemmy.sdf.orglinkfedilinkarrow-up3·1 year agoPlease elaborate. When and why would his suggestion be worse?
minus-squaremellejwz@lemmy.worldlinkfedilinkEnglisharrow-up1arrow-down2·1 year agoIt will check all of the if statements instead of stopping at the first match.
minus-squareValmond@lemmy.mindoki.comlinkfedilinkarrow-up1·1 year agoYeah gotta store the return value in a variable!
There is a simpler way: all the "else if"s can be replaced with simple "if"s
You mean make it even worse.(performance wise)? Interesting.
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
Yeah gotta store the return value in a variable!