cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: simplify primitive compares
Date Wed, 10 Jun 2015 00:53:42 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 17dd4ccc7 -> d1dd3ce72


simplify primitive compares


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

Branch: refs/heads/trunk
Commit: d1dd3ce721dcc0a5175740e6510361595a16328e
Parents: 17dd4cc
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Tue Jun 9 20:53:06 2015 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Tue Jun 9 20:53:06 2015 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java | 4 ++--
 src/java/org/apache/cassandra/tools/nodetool/Ring.java         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1dd3ce7/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java b/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
index ca1969f..2f7ee3a 100644
--- a/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
+++ b/src/java/org/apache/cassandra/db/commitlog/ReplayPosition.java
@@ -70,9 +70,9 @@ public class ReplayPosition implements Comparable<ReplayPosition>
         public int compare(ReplayPosition o1, ReplayPosition o2)
         {
             if (o1.segment != o2.segment)
-                return Long.valueOf(o1.segment).compareTo(o2.segment);
+            	return Long.compare(o1.segment,  o2.segment);
 
-            return Integer.valueOf(o1.position).compareTo(o2.position);
+            return Integer.compare(o1.position, o2.position);
         }
     };
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d1dd3ce7/src/java/org/apache/cassandra/tools/nodetool/Ring.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/nodetool/Ring.java b/src/java/org/apache/cassandra/tools/nodetool/Ring.java
index 5102029..03d9449 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/Ring.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/Ring.java
@@ -65,7 +65,7 @@ public class Ring extends NodeToolCmd
             @Override
             public int compare(String first, String second)
             {
-                return ((Integer) first.length()).compareTo(second.length());
+            	return Integer.compare(first.length(), second.length());
             }
         }).length();
 


Mime
View raw message