aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-04-05 13:26:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-04-05 13:26:37 -0300
commitd394d5536aeccb937fb6fd8e7476b08d672bc892 (patch)
tree82483d3792049e16b5dc8e2573d661ca2acd9573 /ltable.c
parenta2f98314a30859b217d6f7f7741c785a8e029e3c (diff)
downloadlua-d394d5536aeccb937fb6fd8e7476b08d672bc892.tar.gz
lua-d394d5536aeccb937fb6fd8e7476b08d672bc892.tar.bz2
lua-d394d5536aeccb937fb6fd8e7476b08d672bc892.zip
new macro 'eqstr'
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ltable.c b/ltable.c
index 287a5020..c7a7606b 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.46 2009/11/26 11:39:20 roberto Exp roberto $ 2** $Id: ltable.c,v 2.47 2009/12/17 15:46:44 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*/
@@ -31,6 +31,7 @@
31#include "lmem.h" 31#include "lmem.h"
32#include "lobject.h" 32#include "lobject.h"
33#include "lstate.h" 33#include "lstate.h"
34#include "lstring.h"
34#include "ltable.h" 35#include "ltable.h"
35 36
36 37
@@ -452,7 +453,7 @@ const TValue *luaH_getint (Table *t, int key) {
452const TValue *luaH_getstr (Table *t, TString *key) { 453const TValue *luaH_getstr (Table *t, TString *key) {
453 Node *n = hashstr(t, key); 454 Node *n = hashstr(t, key);
454 do { /* check whether `key' is somewhere in the chain */ 455 do { /* check whether `key' is somewhere in the chain */
455 if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key) 456 if (ttisstring(gkey(n)) && eqstr(rawtsvalue(gkey(n)), key))
456 return gval(n); /* that's it */ 457 return gval(n); /* that's it */
457 else n = gnext(n); 458 else n = gnext(n);
458 } while (n); 459 } while (n);