lua-users home
lua-l archive

RE: Progressively worse performance from a table

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


>Could this code be made faster by making "word" a local variable?
>
>local word;
>for word in io.lines("/usr/dict/words") do
No, because the control variables in a for loop are already local (to the
scope of the for loop). See http://www.lua.org/manual/5.0/manual.html#2.4.5 
--lhf

AltStyle によって変換されたページ (->オリジナル) /