mirror of https://github.com/apache/cassandra
use short circuiting ops
This commit is contained in:
parent
30f3899f21
commit
87ef146b4c
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue