[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1 (work1) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 02 Sep 2004 11:29:52 -0300
> That is, 'table.getn' returns the _last_ integer index, and not the
> last before 'nil'.
The new getn returns any integer index before a nil. If the array is
properly formatted (no "holes") this will be the last index. If the
array has holes, this index is not well specified. We thought that
this is as useful (or as useless) as the current smallest index.
The motivation is that the previous algorithm was O(n),
while this one is O(log n).
-- Roberto