diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-04-01 10:52:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-04-01 10:52:41 -0300 |
commit | 7288528a1e081d101a1bc19346a974088b6b8315 (patch) | |
tree | 8a3b73aafaea2d705ea1f53e131d38f29aef52fd /lstate.c | |
parent | 513559cc4760392b6fa33754c516683ef49dba22 (diff) | |
download | lua-7288528a1e081d101a1bc19346a974088b6b8315.tar.gz lua-7288528a1e081d101a1bc19346a974088b6b8315.tar.bz2 lua-7288528a1e081d101a1bc19346a974088b6b8315.zip |
Short strings always use all bytes in the hash
Collisions in short strings occurr just by their existence, when
internalizing them. (Collisions in long strings is caused/controlled
by the program, when adding them as keys to the same table.)
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -76,7 +76,7 @@ static unsigned int luai_makeseed (lua_State *L) { | |||
76 | addbuff(buff, p, &h); /* local variable */ | 76 | addbuff(buff, p, &h); /* local variable */ |
77 | addbuff(buff, p, &lua_newstate); /* public function */ | 77 | addbuff(buff, p, &lua_newstate); /* public function */ |
78 | lua_assert(p == sizeof(buff)); | 78 | lua_assert(p == sizeof(buff)); |
79 | return luaS_hash(buff, p, h); | 79 | return luaS_hash(buff, p, h, 1); |
80 | } | 80 | } |
81 | 81 | ||
82 | #endif | 82 | #endif |