瀏覽代碼

luaH_set does the set, and protects its value, so luaH_move can be a
macro.

Roberto Ierusalimschy 26 年之前
父節點
當前提交
57ffc3f009
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      ltable.h

+ 4 - 4
ltable.h

@@ -1,5 +1,5 @@
 /*
-** $Id: ltable.h,v 1.8 1999/01/04 12:54:33 roberto Exp roberto $
+** $Id: ltable.h,v 1.9 1999/01/25 12:30:11 roberto Exp roberto $
 ** Lua tables (hash)
 ** See Copyright Notice in lua.h
 */
@@ -16,15 +16,15 @@
 #define nhash(t)	((t)->nhash)
 
 #define luaH_get(t,ref)	(val(luaH_present((t), (ref))))
+#define luaH_move(t,from,to)	(luaH_setint(t, to, luaH_getint(t, from)))
 
 Hash *luaH_new (int nhash);
 void luaH_free (Hash *frees);
-Node *luaH_present (Hash *t, TObject *ref);
-TObject *luaH_set (Hash *t, TObject *ref);
+Node *luaH_present (Hash *t, TObject *key);
+void luaH_set (Hash *t, TObject *ref, TObject *val);
 Node *luaH_next (Hash *t, TObject *r);
 void luaH_setint (Hash *t, int ref, TObject *val);
 TObject *luaH_getint (Hash *t, int ref);
-void luaH_move (Hash *t, int from, int to);
 
 
 #endif