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. --- lundump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lundump.c') diff --git a/lundump.c b/lundump.c index 593a4951..51d5dc66 100644 --- a/lundump.c +++ b/lundump.c @@ -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 */ -- cgit v1.2.3-55-g6feb