Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

HPPCRT-49: Heaps wrongly use Comparable/Comparator for contains(), removeAll(), equals(). #54

Closed
vsonnier opened this issue Jul 11, 2017 · 1 comment

Comments

@vsonnier
Copy link
Owner

vsonnier commented Jul 11, 2017

One of my users remarked that it was either wrong to use the Comparable or Comparator for methods involving equality tests in heaps, such as:

  • contains(),
  • removeAll(),
  • equals()

because indeed object equality is a different concept as object ordering, so that compareTo(obj) == 0 cannot be used in place of an object equals() when testing equality.
Consequently make so that the above methods for heaps use equals() instead of the comparison criteria as before.
Besides, that allows

  • contains(),
  • removeAll()

to be consistent with the other KTypeContainer implementations using equals().

@vsonnier vsonnier added this to the Release v0.75 milestone Jul 11, 2017
@vsonnier vsonnier self-assigned this Jul 11, 2017
@vsonnier
Copy link
Owner Author

Done in 9552bcf

@vsonnier vsonnier modified the milestones: Release v0.75, Release v0.76 Apr 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant