Skip to content

Commit

Permalink
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
@@ -276,12 +276,7 @@ private boolean isSingleByteOptimizable(Rope left, Rope right, ConditionProfile
}

private int depth(Rope left, Rope right) {
return max(left.depth(), right.depth()) + 1;
}

private int max(int x, int y) {
// This approach is adapted from http://graphics.stanford.edu/~seander/bithacks.html?1=1#IntegerMinOrMax
return x - ((x - y) & ((x - y) >> (Integer.SIZE - 1)));
return Math.max(left.depth(), right.depth()) + 1;
}

protected static boolean isMutableRope(Rope rope) {

0 comments on commit 127f063

Please sign in to comment.