summaryrefslogtreecommitdiff
path: root/lobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'lobject.c')
-rw-r--r--lobject.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lobject.c b/lobject.c
index a10dfeab..fec0c5e7 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 1.60 2001/01/24 15:45:33 roberto Exp roberto $ 2** $Id: lobject.c,v 1.61 2001/01/25 16:45:36 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -37,15 +37,10 @@ int luaO_equalObj (const TObject *t1, const TObject *t2) {
37 switch (ttype(t1)) { 37 switch (ttype(t1)) {
38 case LUA_TNUMBER: 38 case LUA_TNUMBER:
39 return nvalue(t1) == nvalue(t2); 39 return nvalue(t1) == nvalue(t2);
40 case LUA_TSTRING: case LUA_TUSERDATA: 40 case LUA_TNIL:
41 return 1;
42 default: /* all other types are equal if pointers are equal */
41 return tsvalue(t1) == tsvalue(t2); 43 return tsvalue(t1) == tsvalue(t2);
42 case LUA_TTABLE:
43 return hvalue(t1) == hvalue(t2);
44 case LUA_TFUNCTION:
45 return clvalue(t1) == clvalue(t2);
46 default:
47 lua_assert(ttype(t1) == LUA_TNIL);
48 return 1; /* LUA_TNIL */
49 } 44 }
50} 45}
51 46