Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5171#discussion_r27067256
--- Diff:
core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala ---
@@ -53,6 +53,15 @@ class OpenHashMap[K : ClassTag, @specialized(Long, Int,
Double) V: ClassTag](
override def size: Int = if (haveNullValue) _keySet.size + 1 else
_keySet.size
+ /** Tests whether this map contains a binding for a key. */
+ def contains(k: K): Boolean = {
+ if (k == null) {
+ haveNullValue
+ } else {
+ _keySet.getPos(k) >= 0
--- End diff --
i think the contract is getPos(k) != INVALID_POS
---
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]