removed dirt optimizations that gave small gains

This commit is contained in:
Roberto Ierusalimschy
2005-04-04 15:12:51 -03:00
parent 409ee99900
commit 0316308c0d
4 changed files with 54 additions and 89 deletions

10
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.35 2005/03/21 18:12:21 roberto Exp roberto $
** $Id: lapi.c,v 2.36 2005/03/22 16:04:29 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -526,7 +526,7 @@ LUA_API void lua_gettable (lua_State *L, int idx) {
lua_lock(L);
t = index2adr(L, idx);
api_checkvalidindex(L, t);
luaV_gettable(L, t, L->top - 1, L->top - 1, NULL);
luaV_gettable(L, t, L->top - 1, L->top - 1);
lua_unlock(L);
}
@@ -538,7 +538,7 @@ LUA_API void lua_getfield (lua_State *L, int idx, const char *k) {
t = index2adr(L, idx);
api_checkvalidindex(L, t);
setsvalue(L, &key, luaS_new(L, k));
luaV_gettable(L, t, &key, L->top, NULL);
luaV_gettable(L, t, &key, L->top);
api_incr_top(L);
lua_unlock(L);
}
@@ -632,7 +632,7 @@ LUA_API void lua_settable (lua_State *L, int idx) {
api_checknelems(L, 2);
t = index2adr(L, idx);
api_checkvalidindex(L, t);
luaV_settable(L, t, L->top - 2, L->top - 1, NULL);
luaV_settable(L, t, L->top - 2, L->top - 1);
L->top -= 2; /* pop index and value */
lua_unlock(L);
}
@@ -646,7 +646,7 @@ LUA_API void lua_setfield (lua_State *L, int idx, const char *k) {
t = index2adr(L, idx);
api_checkvalidindex(L, t);
setsvalue(L, &key, luaS_new(L, k));
luaV_settable(L, t, &key, L->top - 1, NULL);
luaV_settable(L, t, &key, L->top - 1);
L->top--; /* pop value */
lua_unlock(L);
}