summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lvm.js b/src/lvm.js
index d48610c..df4f62f 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -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 */
- /* compare them as integers */
- return Math.floor(t1.value) === Math.floor(t2.value) ? 1 : 0; // TODO: tointeger
+ /* OPTIMIZATION: instead of calling luaV_tointeger we can just let JS do the comparison */
+ return (t1.value === t2.value) ? 1 : 0;
}
}