Mercurial Hosting > luan
comparison core/src/luan/impl/EqExpr.java @ 363:17b02b56d806
fix LuanPropertyTable.asMap();
fix binary==binary;
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 16 Apr 2015 10:12:58 -0600 |
parents | 2456ef7ada02 |
children | d55e873e1f0d |
comparison
equal
deleted
inserted
replaced
362:9dbf3433f70f | 363:17b02b56d806 |
---|---|
1 package luan.impl; | 1 package luan.impl; |
2 | 2 |
3 import java.util.Arrays; | |
3 import luan.Luan; | 4 import luan.Luan; |
4 import luan.LuanFunction; | 5 import luan.LuanFunction; |
5 import luan.LuanTable; | 6 import luan.LuanTable; |
6 import luan.LuanException; | 7 import luan.LuanException; |
7 import luan.LuanSource; | 8 import luan.LuanSource; |
26 if( o1 instanceof Number && o2 instanceof Number ) { | 27 if( o1 instanceof Number && o2 instanceof Number ) { |
27 Number n1 = (Number)o1; | 28 Number n1 = (Number)o1; |
28 Number n2 = (Number)o2; | 29 Number n2 = (Number)o2; |
29 return n1.doubleValue() == n2.doubleValue(); | 30 return n1.doubleValue() == n2.doubleValue(); |
30 } | 31 } |
32 if( o1 instanceof byte[] && o2 instanceof byte[] ) { | |
33 byte[] b1 = (byte[])o1; | |
34 byte[] b2 = (byte[])o2; | |
35 return Arrays.equals(b1,b2); | |
36 } | |
31 if( o1==null || o2==null || !o1.getClass().equals(o2.getClass()) ) | 37 if( o1==null || o2==null || !o1.getClass().equals(o2.getClass()) ) |
32 return false; | 38 return false; |
33 LuanTable mt1 = luan.getMetatable(o1); | 39 LuanTable mt1 = luan.getMetatable(o1); |
34 LuanTable mt2 = luan.getMetatable(o2); | 40 LuanTable mt2 = luan.getMetatable(o2); |
35 if( mt1==null || mt2==null ) | 41 if( mt1==null || mt2==null ) |