Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the tests I added and the comment
  • Loading branch information
holdenk committed Mar 8, 2014
commit 238a4d8a78a086b3a13c737b4c97e3e008377b55
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class OpenHashSet[@specialized(Long, Int) T: ClassTag](
* Add an element to the set. This one differs from add in that it doesn't trigger rehashing.
* The caller is responsible for calling rehashIfNeeded.
*
* Use (retval & POSITION_MASK) to get the actual position, and
* (retval & NONEXISTENCE_MASK) != 0 for prior existence.
* Use (retval & _mask) to get the actual position, and
* (retval & NONEXISTENCE_MASK) == 0 for prior existence.
*
* @return The position where the key is placed, plus the highest order bit is set if the key
* exists previously.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class OpenHashSetSuite extends FunSuite with ShouldMatchers {
assert(set.contains(999))
assert(!set.contains(10000))

assert(set.addWithoutResize(50) & set.NONEXISTENCE_MASK != 0)
assert(set.addWithoutResize(10000) & set.NONEXISTENCE_MASK === 0)
assert((set.addWithoutResize(50) & OpenHashSet.NONEXISTENCE_MASK) === 0)
assert((set.addWithoutResize(10000) & OpenHashSet.NONEXISTENCE_MASK) != 0)
}

test("primitive long") {
Expand Down