lua-users home
lua-l archive

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


> It works just like table keys. A hash code is computed from the
> string. Only if that is the same as a string already in the table (in
> which case the strings are likely to be equal) are the actual strings
> compared. O(#str) average speed.

It is worth reminding that this behavior changed in Lua 5.2. Now, only
"short" strings are interned. (By default, a "short string" is up to
40 bytes.)

-- Roberto