[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ordered numeric set vs. tinsert()
- From: "Wim Couwenberg" <w.couwenberg@...>
- Date: Fri, 31 Jan 2003 22:32:31 +0100
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