Skip to content

Commit

Permalink
[SPARK-18200][GRAPHX][FOLLOW-UP] Support zero as an initial capacity …
Browse files Browse the repository at this point in the history
…in OpenHashSet
  • Loading branch information
dongjoon-hyun committed Nov 3, 2016
1 parent 66a99f4 commit 95ad783
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class OpenHashSet[@specialized(Long, Int) T: ClassTag](

private def nextPowerOf2(n: Int): Int = {
if (n == 0) {
2
1
} else {
val highBit = Integer.highestOneBit(n)
if (highBit == n) n else highBit << 1
Expand Down

0 comments on commit 95ad783

Please sign in to comment.