From 4964e7c8a0284a75a57cf591c3b3c77febaf40e6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 2 Sep 2002 16:54:49 -0300 Subject: details --- lobject.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'lobject.c') diff --git a/lobject.c b/lobject.c index f607aab2..5845e695 100644 --- a/lobject.c +++ b/lobject.c @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 1.85 2002/07/17 16:25:13 roberto Exp roberto $ +** $Id: lobject.c,v 1.86 2002/08/07 14:35:55 roberto Exp roberto $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -58,25 +58,17 @@ int luaO_log2 (unsigned int x) { int luaO_rawequalObj (const TObject *t1, const TObject *t2) { if (ttype(t1) != ttype(t2)) return 0; switch (ttype(t1)) { - case LUA_TNUMBER: - return nvalue(t1) == nvalue(t2); case LUA_TNIL: return 1; - case LUA_TSTRING: - return tsvalue(t1) == tsvalue(t2); case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); - case LUA_TUSERDATA: - return uvalue(t1) == uvalue(t2); - case LUA_TTABLE: - return hvalue(t1) == hvalue(t2); - case LUA_TFUNCTION: - return clvalue(t1) == clvalue(t2); + case LUA_TNUMBER: + return nvalue(t1) == nvalue(t2); + default: + return gcvalue(t1) == gcvalue(t2); } - lua_assert(0); - return 0; /* to avoid warnings */ } -- cgit v1.2.3-55-g6feb