mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
made getTrueMask in BitSet a lot more rational with fewer code paths.
This commit is contained in:
parent
7947981b4b
commit
39ad6da290
@ -34,11 +34,7 @@ public class BitSet implements Serializable, Cloneable {
|
|||||||
|
|
||||||
private static long getTrueMask(int fromIndex, int toIndex) {
|
private static long getTrueMask(int fromIndex, int toIndex) {
|
||||||
int currentRange = toIndex - fromIndex;
|
int currentRange = toIndex - fromIndex;
|
||||||
if (currentRange == 64) {
|
return (MASK >>> (BITS_PER_LONG - currentRange)) << (fromIndex % BITS_PER_LONG);
|
||||||
return MASK;
|
|
||||||
} else {
|
|
||||||
return (((1L << currentRange) - 1L) << (fromIndex % BITS_PER_LONG));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BitSet(int bitLength) {
|
public BitSet(int bitLength) {
|
||||||
|
Loading…
Reference in New Issue
Block a user