Skip to content

Commit 8557445

Browse files
committed
Resolved review comments
1 parent 4d5b954 commit 8557445

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class OpenHashSet[@specialized(Long, Int) T: ClassTag](
224224
*/
225225
private def rehash(k: T, allocateFunc: (Int) => Unit, moveFunc: (Int, Int) => Unit) {
226226
val newCapacity = _capacity * 2
227-
require(newCapacity <= OpenHashSet.MAX_CAPACITY,
227+
require(newCapacity > 0 && newCapacity <= OpenHashSet.MAX_CAPACITY,
228228
s"Can't contain more than ${(loadFactor * OpenHashSet.MAX_CAPACITY).toInt} elements")
229229
allocateFunc(newCapacity)
230230
val newBitset = new BitSet(newCapacity)

0 commit comments

Comments
 (0)