lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


D'oh!  RTFM should be tattooed on the back of my hands.  Thanks guys.

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of scott
Sent: Thursday, January 08, 2004 6:20 PM
To: Lua list
Subject: Re: Progressively worse performance from a table

On Thu, Jan 08, 2004 at 06:12:05PM -0500, John Paquin wrote:
> To open a whole new can of worms...
>
> Could this code be made faster by making "word" a local variable?
>

It is no faster on my machine.  Which isn't surprising.  The manual says
that the loop variable is already local:

"The loop variable var is local to the statement; you cannot use its
value after the for ends or is broken. If you need the value of the loop
variable var, then assign it to another variable before breaking or
exiting the loop."

scott

--
------------------------------------------------------------------------
scott jacobs                                   scott+lua@escherichia.net
------------------------------------------------------------------------