lua-users home
lua-l archive

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


>> The # operator has constant complexity I suppose. It doesn't deal with the associative part of a
>> table at all. Moreover, it is not a true "length" operator for the dense part as it works that way
>> only for well-managed sequences.

> Can someone explain why the size (precisely: what # returns) is not stored in the background?
> Naively, I see this as a small cost for a great gain.

Hmm, I've always thought it is already done so. Sorry for misleading about O(1) complexity then.