From 0593256707ceddb1bc9cd4b25b822a7fbcfedd66 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 21 Mar 2024 11:23:21 -0300 Subject: '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. --- ldump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ldump.c') 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) { if (ts == NULL) dumpSize(D, 0); else { - TValue idx = luaH_getstr(D->h, ts); - if (!isemptyV(idx)) { /* string already saved? */ + TValue idx; + int tag = luaH_getstr(D->h, ts, &idx); + if (!tagisempty(tag)) { /* string already saved? */ dumpSize(D, 1); /* reuse a saved string */ dumpSize(D, cast_sizet(ivalue(&idx))); /* index of saved string */ } -- cgit v1.2.3-55-g6feb