cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: no need to compare the scale of the values for equality, just compare the value
Date Sun, 08 Jan 2017 04:04:10 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 18f28c517 -> f0178266e


no need to compare the scale of the values for equality, just compare the value


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f0178266
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f0178266
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f0178266

Branch: refs/heads/trunk
Commit: f0178266ee4287baaf061144f78e8f56f82ae611
Parents: 18f28c5
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Sat Jan 7 23:03:43 2017 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Sat Jan 7 23:03:43 2017 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/cql3/Constants.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f0178266/src/java/org/apache/cassandra/cql3/Constants.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/Constants.java b/src/java/org/apache/cassandra/cql3/Constants.java
index 8d54063..734d1d6 100644
--- a/src/java/org/apache/cassandra/cql3/Constants.java
+++ b/src/java/org/apache/cassandra/cql3/Constants.java
@@ -68,7 +68,7 @@ public abstract class Constants
                 // We only try to determine the smallest possible type between double and
BigDecimal
                 BigDecimal b = new BigDecimal(text);
 
-                if (b.equals(BigDecimal.valueOf(b.doubleValue())))
+                if (b.compareTo(BigDecimal.valueOf(b.doubleValue())) == 0)
                     return DoubleType.instance;
 
                 return DecimalType.instance;


Mime
View raw message