From 1a3656e56eb1c873a4d74661eb44c96c07d662c1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 10 Jun 2014 15:53:18 -0300 Subject: more relaxed rules for __eq metamethod (more similar to other operators) --- ltm.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index 37b5cd3d..dc2e922b 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 2.25 2013/12/30 20:47:58 roberto Exp $ +** $Id: ltm.c,v 2.26 2014/04/11 20:17:39 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -129,19 +129,6 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, } -const TValue *luaT_getequalTM (lua_State *L, Table *mt1, Table *mt2) { - const TValue *tm1 = fasttm(L, mt1, TM_EQ); - const TValue *tm2; - if (tm1 == NULL) return NULL; /* no metamethod */ - if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ - tm2 = fasttm(L, mt2, TM_EQ); - if (tm2 == NULL) return NULL; /* no metamethod */ - if (luaV_rawequalobj(tm1, tm2)) /* same metamethods? */ - return tm1; - return NULL; -} - - int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, TMS event) { if (!luaT_callbinTM(L, p1, p2, L->top, event)) -- cgit v1.2.3-55-g6feb