diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-11-04 14:12:11 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-11-04 14:12:11 +1000 |
commit | d61d007d4852032fcfd339ab2c904a4de6836c4d (patch) | |
tree | cf696021da8e421cdb5dd8014228d237a213891d /src | |
parent | c4fd2ec9a8195de69f878615565c9dcda3687041 (diff) | |
parent | d33ba3bb9c5f09374dd585cc6f0ff6294b98fc6a (diff) | |
download | scala-d61d007d4852032fcfd339ab2c904a4de6836c4d.tar.gz scala-d61d007d4852032fcfd339ab2c904a4de6836c4d.tar.bz2 scala-d61d007d4852032fcfd339ab2c904a4de6836c4d.zip |
Merge pull request #4052 from Lymia/issue/8910
SI-8910 BitSet sometimes uses exponential memory.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/mutable/BitSet.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/scala/collection/mutable/BitSet.scala b/src/library/scala/collection/mutable/BitSet.scala index 43d23acc1a..faa4155317 100644 --- a/src/library/scala/collection/mutable/BitSet.scala +++ b/src/library/scala/collection/mutable/BitSet.scala @@ -110,7 +110,7 @@ class BitSet(protected final var elems: Array[Long]) extends AbstractSet[Int] * @return the bitset itself. */ def |= (other: BitSet): this.type = { - ensureCapacity(other.nwords) + ensureCapacity(other.nwords - 1) for (i <- 0 until other.nwords) elems(i) = elems(i) | other.word(i) this @@ -121,7 +121,7 @@ class BitSet(protected final var elems: Array[Long]) extends AbstractSet[Int] * @return the bitset itself. */ def &= (other: BitSet): this.type = { - ensureCapacity(other.nwords) + ensureCapacity(other.nwords - 1) for (i <- 0 until other.nwords) elems(i) = elems(i) & other.word(i) this @@ -132,7 +132,7 @@ class BitSet(protected final var elems: Array[Long]) extends AbstractSet[Int] * @return the bitset itself. */ def ^= (other: BitSet): this.type = { - ensureCapacity(other.nwords) + ensureCapacity(other.nwords - 1) for (i <- 0 until other.nwords) elems(i) = elems(i) ^ other.word(i) this @@ -143,7 +143,7 @@ class BitSet(protected final var elems: Array[Long]) extends AbstractSet[Int] * @return the bitset itself. */ def &~= (other: BitSet): this.type = { - ensureCapacity(other.nwords) + ensureCapacity(other.nwords - 1) for (i <- 0 until other.nwords) elems(i) = elems(i) & ~other.word(i) this |