lua-users home
lua-l archive

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


On Wed, May 6, 2009 at 5:14 PM, Alexander Gladysh wrote:
> Today I'm benchmarking iterating a table with ipairs vs. numeric for:...
>   for i = 1, #t do
>     if v == nil then
>       break
>     end
>   end
> end
> ...
>         7       [35]    GETGLOBAL       5 -2    ; v

What's v?  Normally, the equivalent numeric loop would loop like

  for i = 1, #t do
    local v = t[i]
  end