Skip to content

Commit

Permalink
Add BitSet#clone
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLogicMaster committed May 27, 2022
1 parent 4b9d879 commit a38d992
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/src/java/util/BitSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ private BitSet(long[] bits, boolean needClear, int actualArrayLength,
this.isLengthActual = isLengthActual;
}

public BitSet clone() {
return new BitSet(Arrays.copyOf(bits, bits.length), needClear, actualArrayLength, isLengthActual);
}

/**
* Compares the argument to this {@code BitSet} and returns whether they are
* equal. The object must be an instance of {@code BitSet} with the same
Expand Down

0 comments on commit a38d992

Please sign in to comment.