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