lua-users home
lua-l archive

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

>In lua tables, fields (with string-indices) are accessed in
>constant time.
>What about the elements of an array (using tables of course)?
>Constant time or linear?

If by array you mean a table indexed with integers, then yes, it's constant
time. Table accesses are done in constant time no matter what type of index.