Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15741#discussion_r86382197
  
    --- Diff: 
core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala ---
    @@ -271,8 +271,12 @@ class OpenHashSet[@specialized(Long, Int) T: ClassTag](
       private def hashcode(h: Int): Int = 
Hashing.murmur3_32().hashInt(h).asInt()
     
       private def nextPowerOf2(n: Int): Int = {
    -    val highBit = Integer.highestOneBit(n)
    -    if (highBit == n) n else highBit << 1
    +    if (n == 0) {
    +      2
    --- End diff --
    
    Oh, sorry. You're right. `nextPowerOf2(1)` is indeed 1. Then, both should 
return 1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to