From d394d5536aeccb937fb6fd8e7476b08d672bc892 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 5 Apr 2010 13:26:37 -0300 Subject: new macro 'eqstr' --- ltable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index 287a5020..c7a7606b 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.46 2009/11/26 11:39:20 roberto Exp roberto $ +** $Id: ltable.c,v 2.47 2009/12/17 15:46:44 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -31,6 +31,7 @@ #include "lmem.h" #include "lobject.h" #include "lstate.h" +#include "lstring.h" #include "ltable.h" @@ -452,7 +453,7 @@ const TValue *luaH_getint (Table *t, int key) { const TValue *luaH_getstr (Table *t, TString *key) { Node *n = hashstr(t, key); do { /* check whether `key' is somewhere in the chain */ - if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key) + if (ttisstring(gkey(n)) && eqstr(rawtsvalue(gkey(n)), key)) return gval(n); /* that's it */ else n = gnext(n); } while (n); -- cgit v1.2.3-55-g6feb