Don't check key equality in RedBlackTree#8783
Merged
lrytz merged 1 commit intoscala:2.13.xfrom Apr 3, 2020
Merged
Conversation
This was left over from 2.12 when they old key would be overwritten. The behavior changed in scala#7481 to comply with the new map/set rules in scala/bug#10415 (comment). I would also call it wrong in 2.12 because equality should be defined exclusively by the Ordering, but we should keep the current behavior for compatibility reasons.
Contributor
Author
|
based on a chat with @mkeskells who noticed the change when backporting the new RedBlackTree code |
Contributor
|
should this me marked [nomerge] or similar to avoid an automatic merge to 2.12 in the future? |
Contributor
Author
|
We only merge forward, not backward. |
Member
|
this looks plausible, but I don't know the code well enough to easily do a proper review. is Mike's implied signoff enough? (and, should there be a test?) |
Member
|
This PR is only a cleanup, it doesn't change behavior. In 2.13.1: Same with this PR: Whereas in 2.12.11 |
Member
|
The observable change is this: in 2.13.1 this was false. |
retronym
added a commit
to retronym/scala
that referenced
this pull request
May 20, 2020
Erroneous commit was: ``` commit 2c620a7 Merge: abcde58 8270221 Author: Jason Zaugg <jzaugg@gmail.com> Date: Thu May 14 11:17:30 2020 +1000 Merge commit '8270221567' into merge/2.12.x-to-2.13.x-20200514 ``` According to scala#8783, which removed `|| k != tree.key`, there was no behaviour change in 2.13.x, this was just a cleanup.
retronym
added a commit
to retronym/scala
that referenced
this pull request
May 20, 2020
Changes from: scala#7481 scala#8783 Backported in: scala@b87dd51#diff-f99536a3327e638dcf239518f2c3f0ceR195 scala@93afae7#diff-f99536a3327e638dcf239518f2c3f0ceL214 ... are reverted. I've added a test for the legacy behaviour that we don't want to break.
hamzaremmal
pushed a commit
to hamzaremmal/scala3
that referenced
this pull request
May 2, 2025
Don't check key equality in RedBlackTree
hamzaremmal
pushed a commit
to hamzaremmal/scala3
that referenced
this pull request
May 2, 2025
Erroneous commit was: ``` commit b42349c Merge: 481bb48 a41e72c Author: Jason Zaugg <jzaugg@gmail.com> Date: Thu May 14 11:17:30 2020 +1000 Merge commit 'a41e72c988' into merge/2.12.x-to-2.13.x-20200514 ``` According to scala/scala#8783, which removed `|| k != tree.key`, there was no behaviour change in 2.13.x, this was just a cleanup.
hamzaremmal
pushed a commit
to hamzaremmal/scala3
that referenced
this pull request
May 2, 2025
Changes from: scala/scala#7481 scala/scala#8783 Backported in: scala/scala@3b637df#diff-f99536a3327e638dcf239518f2c3f0ceR195 scala/scala@1b39caf#diff-f99536a3327e638dcf239518f2c3f0ceL214 ... are reverted. I've added a test for the legacy behaviour that we don't want to break.
hamzaremmal
pushed a commit
to scala/scala3
that referenced
this pull request
May 7, 2025
Don't check key equality in RedBlackTree
hamzaremmal
pushed a commit
to scala/scala3
that referenced
this pull request
May 7, 2025
Erroneous commit was: ``` commit 3bb47b3 Merge: b3ffa32 35910d2 Author: Jason Zaugg <jzaugg@gmail.com> Date: Thu May 14 11:17:30 2020 +1000 Merge commit '35910d2a8a' into merge/2.12.x-to-2.13.x-20200514 ``` According to scala/scala#8783, which removed `|| k != tree.key`, there was no behaviour change in 2.13.x, this was just a cleanup.
hamzaremmal
pushed a commit
to scala/scala3
that referenced
this pull request
May 7, 2025
Changes from: scala/scala#7481 scala/scala#8783 Backported in: scala/scala@9bfb183#diff-f99536a3327e638dcf239518f2c3f0ceR195 scala/scala@48809df#diff-f99536a3327e638dcf239518f2c3f0ceL214 ... are reverted. I've added a test for the legacy behaviour that we don't want to break.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was left over from 2.12 when they old key would be overwritten.
The behavior changed in #7481 to
comply with the new map/set rules in
scala/bug#10415 (comment).
I would also call it wrong in 2.12 because equality should be defined
exclusively by the Ordering, but we should keep the current behavior
for compatibility reasons.