diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-21 11:23:21 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-21 11:23:21 -0300 |
| commit | 0593256707ceddb1bc9cd4b25b822a7fbcfedd66 (patch) | |
| tree | 6c6859b94086b71b27409b565ed34c114f03e7f8 /lundump.c | |
| parent | ce6f5502c99ce9a367e25b678e375db6f8164d73 (diff) | |
| download | lua-0593256707ceddb1bc9cd4b25b822a7fbcfedd66.tar.gz lua-0593256707ceddb1bc9cd4b25b822a7fbcfedd66.tar.bz2 lua-0593256707ceddb1bc9cd4b25b822a7fbcfedd66.zip | |
'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.
Diffstat (limited to 'lundump.c')
| -rw-r--r-- | lundump.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -149,7 +149,8 @@ static void loadString (LoadState *S, Proto *p, TString **sl) { | |||
| 149 | } | 149 | } |
| 150 | else if (size == 1) { /* previously saved string? */ | 150 | else if (size == 1) { /* previously saved string? */ |
| 151 | lua_Integer idx = cast(lua_Integer, loadSize(S)); /* get its index */ | 151 | lua_Integer idx = cast(lua_Integer, loadSize(S)); /* get its index */ |
| 152 | TValue stv = luaH_getint(S->h, idx); /* get its value */ | 152 | TValue stv; |
| 153 | luaH_getint(S->h, idx, &stv); /* get its value */ | ||
| 153 | *sl = ts = tsvalue(&stv); | 154 | *sl = ts = tsvalue(&stv); |
| 154 | luaC_objbarrier(L, p, ts); | 155 | luaC_objbarrier(L, p, ts); |
| 155 | return; /* do not save it again */ | 156 | return; /* do not save it again */ |
