diff options
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 1.15 1998/08/11 16:38:34 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.16 1998/12/30 13:14:46 roberto Exp $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -223,3 +223,13 @@ TObject *luaH_getint (Hash *t, int ref) { | |||
223 | return luaH_get(t, &index); | 223 | return luaH_get(t, &index); |
224 | } | 224 | } |
225 | 225 | ||
226 | |||
227 | void luaH_move (Hash *t, int from, int to) { | ||
228 | TObject index; | ||
229 | TObject *toadd; | ||
230 | ttype(&index) = LUA_T_NUMBER; | ||
231 | nvalue(&index) = to; | ||
232 | toadd = luaH_set(t, &index); | ||
233 | nvalue(&index) = from; | ||
234 | *toadd = *luaH_get(t, &index); | ||
235 | } | ||