From 45e533599f08d849951b49bcab0be4fd735a966d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 15 Dec 1997 14:17:20 -0200 Subject: optimization: closures without upvalues don't need to be closures --- ltable.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index 270d1fa3..f182e4ba 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 1.7 1997/11/21 19:00:46 roberto Exp roberto $ +** $Id: ltable.c,v 1.8 1997/12/09 13:35:19 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -36,9 +36,15 @@ static long int hashindex (TObject *ref) case LUA_T_STRING: case LUA_T_USERDATA: h = (IntPoint)tsvalue(ref); break; - case LUA_T_FUNCTION: + case LUA_T_CLOSURE: h = (IntPoint)clvalue(ref); break; + case LUA_T_PROTO: + h = (IntPoint)tfvalue(ref); + break; + case LUA_T_CPROTO: + h = (IntPoint)fvalue(ref); + break; case LUA_T_ARRAY: h = (IntPoint)avalue(ref); break; -- cgit v1.2.3-55-g6feb