aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-26 11:16:05 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-26 11:16:05 -0300
commitef8263f81fdde2310ebb15c9a3fe5e954d57cab5 (patch)
tree8532d24bcfc4c59212616bdae1b25f087f1eb179 /ltable.c
parent2952bc5fc9cdc05ed061539cb7be26899513f004 (diff)
downloadlua-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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ltable.c b/ltable.c
index c71d627a..be8f67f0 100644
--- a/ltable.c
+++ b/ltable.c
@@ -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*/
135static Node *mainposition (const Table *t, int ktt, const Value *kvl) { 135static 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
157static Node *mainpositionTV (const Table *t, const TValue *key) { 157static 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*/
170static int equalkey (const TValue *k1, const Node *n2) { 170static 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*/
669const TValue *luaH_get (Table *t, const TValue *key) { 669const 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;