aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ltable.c b/ltable.c
index cc3c3dd4..ebd45dda 100644
--- a/ltable.c
+++ b/ltable.c
@@ -143,8 +143,10 @@ static Node *mainposition (const Table *t, int ktt, const Value *kvl) {
143 return hashstr(t, tsvalueraw(*kvl)); 143 return hashstr(t, tsvalueraw(*kvl));
144 case LUA_TLNGSTR: 144 case LUA_TLNGSTR:
145 return hashpow2(t, luaS_hashlongstr(tsvalueraw(*kvl))); 145 return hashpow2(t, luaS_hashlongstr(tsvalueraw(*kvl)));
146 case LUA_TBOOLEAN: 146 case LUA_TFALSE:
147 return hashboolean(t, bvalueraw(*kvl)); 147 return hashboolean(t, 0);
148 case LUA_TTRUE:
149 return hashboolean(t, 1);
148 case LUA_TLIGHTUSERDATA: 150 case LUA_TLIGHTUSERDATA:
149 return hashpointer(t, pvalueraw(*kvl)); 151 return hashpointer(t, pvalueraw(*kvl));
150 case LUA_TLCF: 152 case LUA_TLCF:
@@ -175,14 +177,12 @@ static int equalkey (const TValue *k1, const Node *n2) {
175 if (rawtt(k1) != keytt(n2)) /* not the same variants? */ 177 if (rawtt(k1) != keytt(n2)) /* not the same variants? */
176 return 0; /* cannot be same key */ 178 return 0; /* cannot be same key */
177 switch (ttypetag(k1)) { 179 switch (ttypetag(k1)) {
178 case LUA_TNIL: 180 case LUA_TNIL: case LUA_TFALSE: case LUA_TTRUE:
179 return 1; 181 return 1;
180 case LUA_TNUMINT: 182 case LUA_TNUMINT:
181 return (ivalue(k1) == keyival(n2)); 183 return (ivalue(k1) == keyival(n2));
182 case LUA_TNUMFLT: 184 case LUA_TNUMFLT:
183 return luai_numeq(fltvalue(k1), fltvalueraw(keyval(n2))); 185 return luai_numeq(fltvalue(k1), fltvalueraw(keyval(n2)));
184 case LUA_TBOOLEAN:
185 return bvalue(k1) == bvalueraw(keyval(n2));
186 case LUA_TLIGHTUSERDATA: 186 case LUA_TLIGHTUSERDATA:
187 return pvalue(k1) == pvalueraw(keyval(n2)); 187 return pvalue(k1) == pvalueraw(keyval(n2));
188 case LUA_TLCF: 188 case LUA_TLCF: