Repository navigation
Break StandardOrder.Compare ties between case variants ordinally [patch] - #200
Merged
Merged
Conversation
Compare returned 0 for "Title"/"title" and "MyKey"/"mykey", so a SortedDictionary built on it threw and a SortedSet dropped keys. When the standard-order comparison ties on two different strings, fall back to an ordinal comparison, so 0 means the same string. Fixes #197 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MupvoiQ9WM1vUJoCzYJ6W
|
This was referenced Oct 9, 2026
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.



StandardOrder.Comparereturned 0 for different strings that differ only in case ("Title"/"title","MyKey"/"mykey"). Used as a sorted-collection comparer, it madeSortedDictionarythrow andSortedSetsilently drop keys.When the standard-order comparison ties on two different strings,
Comparenow falls back tostring.CompareOrdinal, so it returns 0 only for the same string. Known keys keep their order relative to each other and to unknown keys.Compareisn't used inside the library, soCombineFrontmatteroutput is unchanged.Tests (
StandardOrderCompareTotalOrderTests): antisymmetry for the issue's case-variant pairs, theSortedDictionaryandSortedSetrepros keeping every key, and the order across positions staying the same. Without the fix, 5 of the 7 tests fail. With it, the full suite passes (304/304).Fixes #197
🤖 Generated with Claude Code
https://claude.ai/code/session_019MupvoiQ9WM1vUJoCzYJ6W
Generated by Claude Code