Optimisation

Mark Morgan makk384 at gmail.com
Tue Mar 3 12:03:17 GMT 2009


On Mon, Mar 2, 2009 at 9:01 PM, Nigel Peck <nigel.peck at miswebdesign.com> wrote:
>
> When the list could be empty, which is faster?
>
> if ( @list ) { foreach ( @list ) { } }
>
> - or just -
>
> foreach ( @list ) { }
>
> Or is it a pointless question?

Sounds like a definite case of premature optimisation.  If it's not
causing issues for production code, ignore it.  If it is, then there's
very likely much bigger problems....

Mark.


More information about the london.pm mailing list