lua-users home
lua-l archive

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

2009/12/10 David Jones <>:
> 2009/12/10 Kristofer Karlsson <>:
>> Also, your "next" implementation seems rather slow, iterating through a
>> table would take O(n^2) time it seems.
> Indeed.  So don't do that then (the doc says this too!).
> The standard table iterator does not use next().

Just to be clear: Doing this: "for k,v in pairs(sometable) do ... end"
is efficient in Jill, and not at all O(n^2).  Well actually this
depends on the underlying implementation of java.util.Hashtable, but
throw away any phone that has an inefficient keys() implementation.