Use $foo = $x || $y || $z; This is much faster (and shorter to say) +than: if ($x) { $foo = $x; } elsif ($y) { $foo = $y; } elsif ($z) { $foo = $z; }
--Jim
In reply to Re: Idiomatic optimizations
by jlongino
in thread Idiomatic optimizations
by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |