diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-26 10:20:45 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-26 10:20:45 -0300 |
commit | 37f3a1c0452439bce1f5c2069ca015af148bf62f (patch) | |
tree | 0ad887fb08400103904dab1954695d28aece0500 /ltests.c | |
parent | 9559c111a32479794acc59fba2cbeab365a567f3 (diff) | |
download | lua-37f3a1c0452439bce1f5c2069ca015af148bf62f.tar.gz lua-37f3a1c0452439bce1f5c2069ca015af148bf62f.tar.bz2 lua-37f3a1c0452439bce1f5c2069ca015af148bf62f.zip |
too much optimization to "break" keys in tables; keep them as TObjects...
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.82 2001/06/06 18:00:19 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.83 2001/06/15 20:36:57 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -298,7 +298,7 @@ static int hash_query (lua_State *L) { | |||
298 | TObject *o = luaA_index(L, 1); | 298 | TObject *o = luaA_index(L, 1); |
299 | luaL_checktype(L, 2, LUA_TTABLE); | 299 | luaL_checktype(L, 2, LUA_TTABLE); |
300 | t = hvalue(luaA_index(L, 2)); | 300 | t = hvalue(luaA_index(L, 2)); |
301 | setobj2key(&n, o); | 301 | setobj(key(&n), o); |
302 | lua_pushnumber(L, luaH_mainposition(t, &n) - t->node); | 302 | lua_pushnumber(L, luaH_mainposition(t, &n) - t->node); |
303 | } | 303 | } |
304 | return 1; | 304 | return 1; |
@@ -317,12 +317,9 @@ static int table_query (lua_State *L) { | |||
317 | } | 317 | } |
318 | else if (i < t->size) { | 318 | else if (i < t->size) { |
319 | if (ttype(val(node(t, i))) != LUA_TNIL || | 319 | if (ttype(val(node(t, i))) != LUA_TNIL || |
320 | ttype_key(node(t, i)) == LUA_TNIL || | 320 | ttype(key(node(t, i))) == LUA_TNIL || |
321 | ttype_key(node(t, i)) == LUA_TNUMBER || | 321 | ttype(key(node(t, i))) == LUA_TNUMBER) { |
322 | tsvalue_key(node(t, i)) != NULL) { | 322 | luaA_pushobject(L, key(node(t, i))); |
323 | TObject o; | ||
324 | setkey2obj(&o, node(t, i)); | ||
325 | luaA_pushobject(L, &o); | ||
326 | } | 323 | } |
327 | else | 324 | else |
328 | lua_pushstring(L, "<undef>"); | 325 | lua_pushstring(L, "<undef>"); |