mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
Full implementation of new representation for arrays
This commit is contained in:
parent
43c8e5bded
commit
08a077d673
5 changed files with 97 additions and 30 deletions
4
lvm.h
4
lvm.h
|
|
@ -90,7 +90,7 @@ typedef enum {
|
|||
if (!ttistable(t)) aux = HNOTATABLE; \
|
||||
else { Table *h = hvalue(t); lua_Unsigned u = l_castS2U(k); \
|
||||
if ((u - 1u < h->alimit)) { \
|
||||
int tag = *getArrTag(h,u); \
|
||||
int tag = *getArrTag(h,(u)-1u); \
|
||||
if (tagisempty(tag)) aux = HNOTFOUND; \
|
||||
else { farr2val(h, u, tag, res); aux = HOK; }} \
|
||||
else { aux = luaH_getint(h, u, res); }}
|
||||
|
|
@ -103,7 +103,7 @@ typedef enum {
|
|||
if (!ttistable(t)) aux = HNOTATABLE; \
|
||||
else { Table *h = hvalue(t); lua_Unsigned u = l_castS2U(k); \
|
||||
if ((u - 1u < h->alimit)) { \
|
||||
lu_byte *tag = getArrTag(h,u); \
|
||||
lu_byte *tag = getArrTag(h,(u)-1u); \
|
||||
if (tagisempty(*tag)) aux = ~cast_int(u); \
|
||||
else { fval2arr(h, u, tag, val); aux = HOK; }} \
|
||||
else { aux = luaH_psetint(h, u, val); }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue