cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject git commit: use Longs.compare instead of nested ?:
Date Wed, 06 Jun 2012 22:36:40 GMT
Updated Branches:
  refs/heads/trunk 383a608e7 -> 355fcf53a


use Longs.compare instead of nested ?:


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

Branch: refs/heads/trunk
Commit: 355fcf53a8dac32fa13e85216a21575ae6f21ad0
Parents: 383a608
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Jun 6 17:36:23 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Jun 6 17:36:23 2012 -0500

----------------------------------------------------------------------
 .../cassandra/db/compaction/CompactionManager.java |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/355fcf53/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 50e955d..31b83b1 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -54,6 +54,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Predicates;
 import com.google.common.collect.Iterators;
+import com.google.common.primitives.Longs;
 
 /**
  * A singleton which manages a private executor of ongoing compactions. A readwrite lock
@@ -255,11 +256,7 @@ public class CompactionManager implements CompactionManagerMBean
                 {
                     public int compare(SSTableReader o1, SSTableReader o2)
                     {
-                        return o1.onDiskLength() < o2.onDiskLength()
-                               ? -1
-                               : o1.onDiskLength() > o2.onDiskLength()
-                                 ? 1
-                                 : 0;
+                        return Longs.compare(o1.onDiskLength(), o2.onDiskLength());
                     }
                 });
 


Mime
View raw message