lua-users home
lua-l archive

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


Hi,

> I can't use foreachi(). For instance, this takes about half a minute to
> execute here:

It's not so bad.  What Peter suggested was to use a three-step process:
first extract the keys from your set in a seperate list, then sort this list
of keys and finally use this list to index the original set.  In fact, in
Lua this is pleasantly fast (in my experience.)  The foreachi construction
that Peter uses iterates _only_ over the existing keys, i.e. exactly one in
your example!

Bye,
Wim