[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ordered numeric set vs. tinsert()
- From: "Fabio Reis Cecin" <frcecin@...>
- Date: Fri, 31 Jan 2003 20:04:37 -0200
On 31 Jan 2003, at 22:32, Wim Couwenberg wrote:
> 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
D'oh - I got it now!
I guess it should be fast enough, especially for small sets.
A dedicated solution should be a bit faster (of course...), with bigger
sets especially.
I have good alternatives now, thanks Peter and Wim!
--
[]'s
Fábio R. Cecin
frcecin@terra.com.br