diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-18 15:56:32 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-18 15:56:32 -0300 |
commit | ce6f5502c99ce9a367e25b678e375db6f8164d73 (patch) | |
tree | 47f36dc2f6da96dfda325d7b587f3a20599e9317 /lcode.c | |
parent | ba710603811c68fe3a69b3bb98e9038d37489a79 (diff) | |
download | lua-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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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 | */ |
543 | static int addk (FuncState *fs, TValue *key, TValue *v) { | 543 | static 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) && |