lua-users home
lua-l archive

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


> 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