aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-03-18 15:56:32 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-03-18 15:56:32 -0300
commitce6f5502c99ce9a367e25b678e375db6f8164d73 (patch)
tree47f36dc2f6da96dfda325d7b587f3a20599e9317 /lcode.c
parentba710603811c68fe3a69b3bb98e9038d37489a79 (diff)
downloadlua-ce6f5502c99ce9a367e25b678e375db6f8164d73.tar.gz
lua-ce6f5502c99ce9a367e25b678e375db6f8164d73.tar.bz2
lua-ce6f5502c99ce9a367e25b678e375db6f8164d73.zip
'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.)
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c5
1 files changed, 2 insertions, 3 deletions
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) {
541** a function can make some indices wrong. 541** a function can make some indices wrong.
542*/ 542*/
543static int addk (FuncState *fs, TValue *key, TValue *v) { 543static int addk (FuncState *fs, TValue *key, TValue *v) {
544 TValue val;
545 lua_State *L = fs->ls->L; 544 lua_State *L = fs->ls->L;
546 Proto *f = fs->f; 545 Proto *f = fs->f;
547 int aux = luaH_get(fs->ls->h, key, &val); /* query scanner table */ 546 TValue val = luaH_get(fs->ls->h, key); /* query scanner table */
548 int k, oldsize; 547 int k, oldsize;
549 if (aux == HOK && ttisinteger(&val)) { /* is there an index there? */ 548 if (ttisintegerV(val)) { /* is there an index there? */
550 k = cast_int(ivalue(&val)); 549 k = cast_int(ivalue(&val));
551 /* correct value? (warning: must distinguish floats from integers!) */ 550 /* correct value? (warning: must distinguish floats from integers!) */
552 if (k < fs->nk && ttypetag(&f->k[k]) == ttypetag(v) && 551 if (k < fs->nk && ttypetag(&f->k[k]) == ttypetag(v) &&