[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Benchmark
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 20 Jul 1999 15:40:40 -0300 (EST)
>From lua-l@tecgraf.puc-rio.br Tue Jul 20 15:38:03 1999
>From: erik@hougaard.com (Erik Hougaard)
>Roberto Ierusalimschy wrote:
>>
>> You can make the code ~20% faster using local variables:
>>
>> function sieve(n)
>> local x = {}
>
>From the "correctness" perspective x should be a global variable,
>otherwise your would not be able to read the sieve list afterward.
You can always return x. The variable is local, but not the table it contains.
(If you do not return it, it will be collected as garbage, though.)
--lhf