mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
'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:
parent
ce6f5502c9
commit
0593256707
10 changed files with 139 additions and 133 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue