diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-15 14:17:20 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-15 14:17:20 -0200 |
| commit | 45e533599f08d849951b49bcab0be4fd735a966d (patch) | |
| tree | b8e3b175989f694391dd3da4191894f5df1e7d75 /ltable.c | |
| parent | 94144a7821c0fa412d5d228ab5197a8ebaaa3c25 (diff) | |
| download | lua-45e533599f08d849951b49bcab0be4fd735a966d.tar.gz lua-45e533599f08d849951b49bcab0be4fd735a966d.tar.bz2 lua-45e533599f08d849951b49bcab0be4fd735a966d.zip | |
optimization: closures without upvalues don't need to be closures
Diffstat (limited to 'ltable.c')
| -rw-r--r-- | ltable.c | 10 |
1 files changed, 8 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 1.7 1997/11/21 19:00:46 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.8 1997/12/09 13:35:19 roberto Exp roberto $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -36,9 +36,15 @@ static long int hashindex (TObject *ref) | |||
| 36 | case LUA_T_STRING: case LUA_T_USERDATA: | 36 | case LUA_T_STRING: case LUA_T_USERDATA: |
| 37 | h = (IntPoint)tsvalue(ref); | 37 | h = (IntPoint)tsvalue(ref); |
| 38 | break; | 38 | break; |
| 39 | case LUA_T_FUNCTION: | 39 | case LUA_T_CLOSURE: |
| 40 | h = (IntPoint)clvalue(ref); | 40 | h = (IntPoint)clvalue(ref); |
| 41 | break; | 41 | break; |
| 42 | case LUA_T_PROTO: | ||
| 43 | h = (IntPoint)tfvalue(ref); | ||
| 44 | break; | ||
| 45 | case LUA_T_CPROTO: | ||
| 46 | h = (IntPoint)fvalue(ref); | ||
| 47 | break; | ||
| 42 | case LUA_T_ARRAY: | 48 | case LUA_T_ARRAY: |
| 43 | h = (IntPoint)avalue(ref); | 49 | h = (IntPoint)avalue(ref); |
| 44 | break; | 50 | break; |
