Re: about strings in lua
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: about strings in lua
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2006年6月11日 21:55:02 -0300
> If I remeber correctly I have read somewhere that strings in Lua
> have special internal representation and Lua does not look at
> every byte in them.
Lua does not look at every byte in a string for computing its hash value
when the string is interned in Lua. After that, Lua looks into a chain
of strings with the same hash to determine whether the string is already
present in Lua. At that moment, Lua looks at all bytes using memcmp.
See http://www.lua.org/source/5.1/lstring.c.html#luaS_newlstr
--lhf