diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-08 21:00:41 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-09 14:25:51 +1000 |
commit | 9d1b2502045fe7d7bb86570779636c9bbc2ba19a (patch) | |
tree | 839179de719be4d0a1d94f5ed6c8c0807ef27698 /src/ltable.js | |
parent | 048234f2ceaad1801473bf8a95219d08797b5e9d (diff) | |
download | fengari-9d1b2502045fe7d7bb86570779636c9bbc2ba19a.tar.gz fengari-9d1b2502045fe7d7bb86570779636c9bbc2ba19a.tar.bz2 fengari-9d1b2502045fe7d7bb86570779636c9bbc2ba19a.zip |
Cache string hashes in TString
Diffstat (limited to 'src/ltable.js')
-rw-r--r-- | src/ltable.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ltable.js b/src/ltable.js index a2987d3..1b55256 100644 --- a/src/ltable.js +++ b/src/ltable.js @@ -24,7 +24,7 @@ const table_hash = function(key) { return key.value; case CT.LUA_TSHRSTR: case CT.LUA_TLNGSTR: - return lstring.luaS_hash(key.value); + return lstring.luaS_hashlongstr(key.tsvalue()); default: throw new Error("unknown key type: " + key.type); } @@ -54,7 +54,7 @@ const luaH_getint = function(t, key) { const luaH_getstr = function(t, key) { assert(key instanceof lstring.TString); - return getgeneric(t, lstring.luaS_hash(key)); + return getgeneric(t, lstring.luaS_hashlongstr(key)); }; const luaH_get = function(t, key) { |