Github user SlavikBaranov commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6763#discussion_r32510295
  
    --- Diff: 
core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala ---
    @@ -223,6 +224,8 @@ class OpenHashSet[@specialized(Long, Int) T: ClassTag](
        */
       private def rehash(k: T, allocateFunc: (Int) => Unit, moveFunc: (Int, 
Int) => Unit) {
         val newCapacity = _capacity * 2
    +    require(newCapacity <= OpenHashSet.MAX_CAPACITY,
    --- End diff --
    
    @srowen Integer overflow is not possible with current MAX_CAPACITY setting, 
since 2^31 is still positive number. Anyway, I've added check for positive 
capacity. IMO it's more clear way to guard against overflow.


---
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