'luaH_get' functions return 'TValue'

Instead of receiving a parameter telling them where to put the result
of the query, these functions return the TValue directly. (That is,
they return a structure.)
This commit is contained in:
Roberto Ierusalimschy
2024-03-18 15:56:32 -03:00
parent ba71060381
commit ce6f5502c9
9 changed files with 124 additions and 122 deletions

View File

@@ -132,8 +132,8 @@ static void dumpString (DumpState *D, TString *ts) {
if (ts == NULL)
dumpSize(D, 0);
else {
TValue idx;
if (luaH_getstr(D->h, ts, &idx) == HOK) { /* string already saved? */
TValue idx = luaH_getstr(D->h, ts);
if (!isemptyV(idx)) { /* string already saved? */
dumpSize(D, 1); /* reuse a saved string */
dumpSize(D, cast_sizet(ivalue(&idx))); /* index of saved string */
}