From 07c7fdb9df82c7fc4ae501e21262f781df4ae5e5 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 29 Jul 2014 13:22:24 -0300 Subject: simpler definition for 'setobj' (trust the compiler for the assignment) --- ltable.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index a234bebb..543c34df 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.91 2014/06/26 16:17:35 roberto Exp roberto $ +** $Id: ltable.c,v 2.92 2014/07/18 13:36:14 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -309,7 +309,7 @@ static void setnodevector (lua_State *L, Table *t, int size) { for (i=0; ii_key, key); luaC_barrierback(L, t, key); lua_assert(ttisnil(gval(mp))); return gval(mp); @@ -503,7 +503,8 @@ const TValue *luaH_getstr (Table *t, TString *key) { Node *n = hashstr(t, key); lua_assert(key->tt == LUA_TSHRSTR); for (;;) { /* check whether `key' is somewhere in the chain */ - if (ttisshrstring(gkey(n)) && eqshrstr(tsvalue(gkey(n)), key)) + const TValue *k = gkey(n); + if (ttisshrstring(k) && eqshrstr(tsvalue(k), key)) return gval(n); /* that's it */ else { int nx = gnext(n); -- cgit v1.2.3-55-g6feb