new implementation of hash tables.

This commit is contained in:
Roberto Ierusalimschy
1999-10-14 17:13:31 -02:00
parent b6ebbb2fee
commit 4e9f2d13d5
9 changed files with 287 additions and 129 deletions

4
lvm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 1.61 1999/09/06 13:55:09 roberto Exp roberto $
** $Id: lvm.c,v 1.62 1999/09/17 16:53:54 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -107,7 +107,7 @@ void luaV_gettable (void) {
int tg = table->value.a->htag;
im = luaT_getim(tg, IM_GETTABLE);
if (ttype(im) == LUA_T_NIL) { /* and does not have a "gettable" method */
TObject *h = luaH_get(avalue(table), table+1);
const TObject *h = luaH_get(avalue(table), table+1);
if (ttype(h) == LUA_T_NIL &&
(ttype(im=luaT_getim(tg, IM_INDEX)) != LUA_T_NIL)) {
/* result is nil and there is an "index" tag method */