MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaV_equalval

Function luaV_equalval

Source/Misc/lua/src/lua.c:15084–15108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15082
15083
15084int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) {
15085const TValue *tm;
15086lua_assert(ttype(t1) == ttype(t2));
15087switch (ttype(t1)) {
15088case LUA_TNIL: return 1;
15089case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2));
15090case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */
15091case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2);
15092case LUA_TUSERDATA: {
15093if (uvalue(t1) == uvalue(t2)) return 1;
15094tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable,
15095TM_EQ);
15096break; /* will try TM */
15097}
15098case LUA_TTABLE: {
15099if (hvalue(t1) == hvalue(t2)) return 1;
15100tm = get_compTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ);
15101break; /* will try TM */
15102}
15103default: return gcvalue(t1) == gcvalue(t2);
15104}
15105if (tm == NULL) return 0; /* no TM? */
15106callTMres(L, L->top, tm, t1, t2); /* call TM */
15107return !l_isfalse(L->top);
15108}
15109
15110
15111void luaV_concat (lua_State *L, int total, int last) {

Callers

nothing calls this directly

Calls 2

get_compTMFunction · 0.85
callTMresFunction · 0.85

Tested by

no test coverage detected