From ce6f5502c99ce9a367e25b678e375db6f8164d73 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 18 Mar 2024 15:56:32 -0300 Subject: '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.) --- lcode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index 0d888822..18bf9413 100644 --- a/lcode.c +++ b/lcode.c @@ -541,12 +541,11 @@ static void freeexps (FuncState *fs, expdesc *e1, expdesc *e2) { ** a function can make some indices wrong. */ static int addk (FuncState *fs, TValue *key, TValue *v) { - TValue val; lua_State *L = fs->ls->L; Proto *f = fs->f; - int aux = luaH_get(fs->ls->h, key, &val); /* query scanner table */ + TValue val = luaH_get(fs->ls->h, key); /* query scanner table */ int k, oldsize; - if (aux == HOK && ttisinteger(&val)) { /* is there an index there? */ + if (ttisintegerV(val)) { /* is there an index there? */ k = cast_int(ivalue(&val)); /* correct value? (warning: must distinguish floats from integers!) */ if (k < fs->nk && ttypetag(&f->k[k]) == ttypetag(v) && -- cgit v1.2.3-55-g6feb