aboutsummaryrefslogtreecommitdiff
path: root/ldump.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-03-21 11:23:21 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-03-21 11:23:21 -0300
commit0593256707ceddb1bc9cd4b25b822a7fbcfedd66 (patch)
tree6c6859b94086b71b27409b565ed34c114f03e7f8 /ldump.c
parentce6f5502c99ce9a367e25b678e375db6f8164d73 (diff)
downloadlua-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 'ldump.c')
-rw-r--r--ldump.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ldump.c b/ldump.c
index 34b63a8a..ca708a41 100644
--- a/ldump.c
+++ b/ldump.c
@@ -132,8 +132,9 @@ static void dumpString (DumpState *D, TString *ts) {
132 if (ts == NULL) 132 if (ts == NULL)
133 dumpSize(D, 0); 133 dumpSize(D, 0);
134 else { 134 else {
135 TValue idx = luaH_getstr(D->h, ts); 135 TValue idx;
136 if (!isemptyV(idx)) { /* string already saved? */ 136 int tag = luaH_getstr(D->h, ts, &idx);
137 if (!tagisempty(tag)) { /* string already saved? */
137 dumpSize(D, 1); /* reuse a saved string */ 138 dumpSize(D, 1); /* reuse a saved string */
138 dumpSize(D, cast_sizet(ivalue(&idx))); /* index of saved string */ 139 dumpSize(D, cast_sizet(ivalue(&idx))); /* index of saved string */
139 } 140 }