summaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-01-16 14:54:37 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-01-16 14:54:37 -0200
commit7e2015a46df7976bddee313b994742e49e420714 (patch)
tree0b2db30f1214a478ccb3664d165c8a431f0d5850 /ltable.c
parent5b01cb39b5ec36c544152351c35c43149d9bbfec (diff)
downloadlua-github-7e2015a46df7976bddee313b994742e49e420714.tar.gz
size of short strings stored in a single byte, to reduce the size
of struct 'TString'
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ltable.c b/ltable.c
index 563ae6de..26b1f773 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltable.c,v 2.99 2014/11/02 19:19:04 roberto Exp roberto $
+** $Id: ltable.c,v 2.100 2015/01/05 13:52:37 roberto Exp roberto $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ -127,7 +127,7 @@ static Node *mainposition (const Table *t, const TValue *key) {
case LUA_TLNGSTR: {
TString *s = tsvalue(key);
if (s->extra == 0) { /* no hash? */
- s->hash = luaS_hash(getstr(s), s->len, s->hash);
+ s->hash = luaS_hash(getstr(s), s->u.lnglen, s->hash);
s->extra = 1; /* now it has its hash */
}
return hashstr(t, tsvalue(key));