diff options
-rw-r--r-- | src/lvm.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -713,8 +713,8 @@ const luaV_equalobj = function(L, t1, t2) { if (t1.ttnov() !== t2.ttnov() || t1.ttnov() !== CT.LUA_TNUMBER) return 0; /* only numbers can be equal with different variants */ else { /* two numbers with different variants */ - let i1, i2; /* compare them as integers */ - return (((i1 = luaV_tointeger(t1, 0)) !== false) && ((i2 = luaV_tointeger(t2, 0)) !== false) && (i1 === i2)) ? 1 : 0; + /* OPTIMIZATION: instead of calling luaV_tointeger we can just let JS do the comparison */ + return (t1.value === t2.value) ? 1 : 0; } } |