diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-26 11:16:05 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-26 11:16:05 -0300 |
commit | ef8263f81fdde2310ebb15c9a3fe5e954d57cab5 (patch) | |
tree | 8532d24bcfc4c59212616bdae1b25f087f1eb179 /ltable.c | |
parent | 2952bc5fc9cdc05ed061539cb7be26899513f004 (diff) | |
download | lua-ef8263f81fdde2310ebb15c9a3fe5e954d57cab5.tar.gz lua-ef8263f81fdde2310ebb15c9a3fe5e954d57cab5.tar.bz2 lua-ef8263f81fdde2310ebb15c9a3fe5e954d57cab5.zip |
better names for macros for tags and types.
rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag;
tnov -> ttype
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.133 2018/02/21 12:54:26 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.134 2018/02/23 13:13:31 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -133,7 +133,7 @@ static int l_hashfloat (lua_Number n) { | |||
133 | ** nodes. | 133 | ** nodes. |
134 | */ | 134 | */ |
135 | static Node *mainposition (const Table *t, int ktt, const Value *kvl) { | 135 | static Node *mainposition (const Table *t, int ktt, const Value *kvl) { |
136 | switch (ttyperaw(ktt)) { | 136 | switch (withvariant(ktt)) { |
137 | case LUA_TNUMINT: | 137 | case LUA_TNUMINT: |
138 | return hashint(t, ivalueraw(*kvl)); | 138 | return hashint(t, ivalueraw(*kvl)); |
139 | case LUA_TNUMFLT: | 139 | case LUA_TNUMFLT: |
@@ -155,7 +155,7 @@ static Node *mainposition (const Table *t, int ktt, const Value *kvl) { | |||
155 | 155 | ||
156 | 156 | ||
157 | static Node *mainpositionTV (const Table *t, const TValue *key) { | 157 | static Node *mainpositionTV (const Table *t, const TValue *key) { |
158 | return mainposition(t, rttype(key), valraw(key)); | 158 | return mainposition(t, rawtt(key), valraw(key)); |
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
@@ -168,9 +168,9 @@ static Node *mainpositionTV (const Table *t, const TValue *key) { | |||
168 | ** default case. | 168 | ** default case. |
169 | */ | 169 | */ |
170 | static int equalkey (const TValue *k1, const Node *n2) { | 170 | static int equalkey (const TValue *k1, const Node *n2) { |
171 | if (rttype(k1) != keytt(n2)) /* not the same variants? */ | 171 | if (rawtt(k1) != keytt(n2)) /* not the same variants? */ |
172 | return 0; /* cannot be same key */ | 172 | return 0; /* cannot be same key */ |
173 | switch (ttype(k1)) { | 173 | switch (ttypetag(k1)) { |
174 | case LUA_TNIL: | 174 | case LUA_TNIL: |
175 | return 1; | 175 | return 1; |
176 | case LUA_TNUMINT: | 176 | case LUA_TNUMINT: |
@@ -667,7 +667,7 @@ const TValue *luaH_getstr (Table *t, TString *key) { | |||
667 | ** main search function | 667 | ** main search function |
668 | */ | 668 | */ |
669 | const TValue *luaH_get (Table *t, const TValue *key) { | 669 | const TValue *luaH_get (Table *t, const TValue *key) { |
670 | switch (ttype(key)) { | 670 | switch (ttypetag(key)) { |
671 | case LUA_TSHRSTR: return luaH_getshortstr(t, tsvalue(key)); | 671 | case LUA_TSHRSTR: return luaH_getshortstr(t, tsvalue(key)); |
672 | case LUA_TNUMINT: return luaH_getint(t, ivalue(key)); | 672 | case LUA_TNUMINT: return luaH_getint(t, ivalue(key)); |
673 | case LUA_TNIL: return luaH_emptyobject; | 673 | case LUA_TNIL: return luaH_emptyobject; |