aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lvm.c b/lvm.c
index 1025e885..ed32455c 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.238 2015/03/30 15:45:01 roberto Exp roberto $ 2** $Id: lvm.c,v 2.239 2015/04/10 17:56:25 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -301,10 +301,8 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
301 if (ttnov(t1) != ttnov(t2) || ttnov(t1) != LUA_TNUMBER) 301 if (ttnov(t1) != ttnov(t2) || ttnov(t1) != LUA_TNUMBER)
302 return 0; /* only numbers can be equal with different variants */ 302 return 0; /* only numbers can be equal with different variants */
303 else { /* two numbers with different variants */ 303 else { /* two numbers with different variants */
304 lua_Number n1, n2; /* compare them as floats */ 304 lua_Integer i1, i2; /* compare them as integers */
305 lua_assert(ttisnumber(t1) && ttisnumber(t2)); 305 return (tointeger(t1, &i1) && tointeger(t2, &i2) && i1 == i2);
306 cast_void(tofloat(t1, &n1)); cast_void(tofloat(t2, &n2));
307 return luai_numeq(n1, n2);
308 } 306 }
309 } 307 }
310 /* values have same type and same variant */ 308 /* values have same type and same variant */