-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug with sorting & uniquifying when using a locale
The locale comparer can return equal for strings which are different. For example, when sorting with `en-US` the following strings are equal: A a ª This means that the sorter would simply keep these in their original order. That means that the sorted output would depend on the original order, meaning two files with different orderings but the same lines would sort differently. This also broke the `--unique` flag because the `lines.dedup_by` call relies on duplicate lines being adjacent. If they're not it won't properly dedup the `Vec`.
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--sort text --case-insensitive --locale en-US --unique | ||
#### | ||
NotSorted | ||
#### | ||
ª | ||
A | ||
a | ||
ª | ||
A | ||
a | ||
#### | ||
A | ||
a | ||
ª |