cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: use short circuiting ops
Date Wed, 01 Apr 2015 23:16:53 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 30f3899f2 -> 87ef146b4


use short circuiting ops


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

Branch: refs/heads/trunk
Commit: 87ef146b4c6ad5b43b48b95af759329898bb6e01
Parents: 30f3899
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Wed Apr 1 19:16:40 2015 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Wed Apr 1 19:16:40 2015 -0400

----------------------------------------------------------------------
 .../apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java   | 2 +-
 .../org/apache/cassandra/stress/generate/PartitionIterator.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/87ef146b/src/java/org/apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java b/src/java/org/apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java
index ac3bae5..c05b5b2 100644
--- a/src/java/org/apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java
+++ b/src/java/org/apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java
@@ -256,7 +256,7 @@ public abstract class UnbufferedDataOutputStreamPlus extends DataOutputStreamPlu
         for (int i = 0 ; i < length ; i++)
         {
             int ch = str.charAt(i);
-            if ((ch > 0) & (ch <= 127))
+            if ((ch > 0) && (ch <= 127))
                 utfCount += 1;
             else if (ch <= 2047)
                 utfCount += 2;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/87ef146b/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
b/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
index 3a8693d..357699d 100644
--- a/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
+++ b/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
@@ -298,7 +298,7 @@ public abstract class PartitionIterator implements Iterator<Row>
             for (int i = 0 ; i <= depth ; i++)
             {
                 int p = currentRow[i], l = lastRow[i], r = clusteringComponents[i].size();
-                if ((p == l) | (r == 1))
+                if ((p == l) || (r == 1))
                     continue;
                 return p - l;
             }


Mime
View raw message