aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-04-01 10:52:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-04-01 10:52:41 -0300
commit7288528a1e081d101a1bc19346a974088b6b8315 (patch)
tree8a3b73aafaea2d705ea1f53e131d38f29aef52fd /lstate.c
parent513559cc4760392b6fa33754c516683ef49dba22 (diff)
downloadlua-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lstate.c b/lstate.c
index 7770e314..8fba70d7 100644
--- a/lstate.c
+++ b/lstate.c
@@ -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