From 39ad6da2901f3a176f2c41c95e24086788a0a91d Mon Sep 17 00:00:00 2001 From: Mike Keesey Date: Fri, 6 Jul 2012 23:42:54 -0600 Subject: [PATCH] made getTrueMask in BitSet a lot more rational with fewer code paths. --- classpath/java/util/BitSet.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/classpath/java/util/BitSet.java b/classpath/java/util/BitSet.java index d27dd05c3c..6705c01cb7 100644 --- a/classpath/java/util/BitSet.java +++ b/classpath/java/util/BitSet.java @@ -34,11 +34,7 @@ public class BitSet implements Serializable, Cloneable { private static long getTrueMask(int fromIndex, int toIndex) { int currentRange = toIndex - fromIndex; - if (currentRange == 64) { - return MASK; - } else { - return (((1L << currentRange) - 1L) << (fromIndex % BITS_PER_LONG)); - } + return (MASK >>> (BITS_PER_LONG - currentRange)) << (fromIndex % BITS_PER_LONG); } public BitSet(int bitLength) {