use short circuiting ops

This commit is contained in:
Dave Brosius 2015-04-01 19:16:40 -04:00
parent 30f3899f21
commit 87ef146b4c
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;
}