Merge pull request #435 from niuys/patch-1

reduce needless 'add_string' call
This commit is contained in:
cloudwu
2016-01-11 15:56:52 +08:00

View File

@@ -419,8 +419,11 @@ luaS_clonestring(lua_State *L, TString *ts) {
result = query_ptr(ts);
if (result)
return result;
// ts is not in SSM, so recalc hash, and add it to SSM
h = luaS_hash(str, l, 0);
result = query_string(h, str, l);
if (result)
return result;
// ts is not in SSM, so recalc hash, and add it to SSM
return add_string(h, str, l);
}