From 654b16e83aad64643d524295300cf29677b7f2ba Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 5 Jul 2001 17:31:14 -0300 Subject: better performance for table operations (mainly for integer indices) --- ltests.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 8e7c2930..a8a1cd98 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 1.85 2001/06/28 15:06:20 roberto Exp roberto $ +** $Id: ltests.c,v 1.86 2001/06/28 19:58:57 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -251,13 +251,11 @@ static int hash_query (lua_State *L) { lua_pushnumber(L, tsvalue(luaA_index(L, 1))->tsv.hash); } else { - Hash *t; - Node n; TObject *o = luaA_index(L, 1); + Hash *t; luaL_checktype(L, 2, LUA_TTABLE); t = hvalue(luaA_index(L, 2)); - setobj(key(&n), o); - lua_pushnumber(L, luaH_mainposition(t, &n) - t->node); + lua_pushnumber(L, luaH_mainposition(t, o) - t->node); } return 1; } -- cgit v1.2.3-55-g6feb