'luaH_get' functions return tag of the result

Undoing previous commit. Returning TValue increases code size without
any visible gains. Returning the tag is a little simpler than returning
a special code (HOK/HNOTFOUND) and the tag is useful by itself in
some cases.
This commit is contained in:
Roberto Ierusalimschy
2024-03-21 11:23:21 -03:00
parent ce6f5502c9
commit 0593256707
10 changed files with 139 additions and 133 deletions

View File

@@ -149,7 +149,8 @@ static void loadString (LoadState *S, Proto *p, TString **sl) {
}
else if (size == 1) { /* previously saved string? */
lua_Integer idx = cast(lua_Integer, loadSize(S)); /* get its index */
TValue stv = luaH_getint(S->h, idx); /* get its value */
TValue stv;
luaH_getint(S->h, idx, &stv); /* get its value */
*sl = ts = tsvalue(&stv);
luaC_objbarrier(L, p, ts);
return; /* do not save it again */