| 170 | |
| 171 | |
| 172 | static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2, |
| 173 | TMS event) { |
| 174 | const TValue *tm1 = fasttm(L, mt1, event); |
| 175 | const TValue *tm2; |
| 176 | if (tm1 == NULL) return NULL; /* no metamethod */ |
| 177 | if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ |
| 178 | tm2 = fasttm(L, mt2, event); |
| 179 | if (tm2 == NULL) return NULL; /* no metamethod */ |
| 180 | if (luaO_rawequalObj(tm1, tm2)) /* same metamethods? */ |
| 181 | return tm1; |
| 182 | return NULL; |
| 183 | } |
| 184 | |
| 185 | |
| 186 | static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, |
no test coverage detected