Skip to content

Conversation

@sovdeeth
Copy link
Member

@sovdeeth sovdeeth commented Jun 6, 2025

Problem

See #7926. Sorting a list with 2 of the same value would result in a sorted list with only 1 of that value instead of 2.

Solution

This was due to using a map to tie current and mapped values, which only allowed a single current value. The solution was to move to a List of paired values, which allows as many duplicated as desired.

Testing Completed

Added a regression test.

Supporting Information


Completes: #7926
Related: none

@sovdeeth sovdeeth added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jun 6, 2025
@sovdeeth sovdeeth marked this pull request as ready for review June 6, 2025 22:33
@sovdeeth sovdeeth requested a review from a team as a code owner June 6, 2025 22:33
@sovdeeth sovdeeth requested review from Burbulinis and TheMug06 and removed request for a team June 6, 2025 22:33
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jun 6, 2025
@sovdeeth sovdeeth linked an issue Jun 6, 2025 that may be closed by this pull request
1 task
@sovdeeth sovdeeth moved this to In Review in 2.12 Releases Jun 6, 2025
Copy link
Contributor

@TheMug06 TheMug06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.12 Releases Jun 7, 2025
@skriptlang-automation skriptlang-automation bot added patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. and removed needs reviews A PR that needs additional reviews labels Jun 7, 2025
@Burbulinis Burbulinis merged commit a5f34ac into dev/patch Jun 9, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done in 2.12 Releases Jun 9, 2025
Burbulinis pushed a commit to Burbulinis/Skript that referenced this pull request Jul 9, 2025
Fix duplicate clobbering by moving away from a map.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version.

Projects

Status: Done - Released

Development

Successfully merging this pull request may close these issues.

sort ... by map value unexpectedly removes duplicate elements

5 participants