-
Notifications
You must be signed in to change notification settings - Fork 549
Make plugin ordering culture-invariant and deterministic #9254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Lukasz Rozmej <[email protected]>
Co-authored-by: Lukasz Rozmej <[email protected]>
Ok I'm now trying to think does it really make that much sense...
|
@LukaszRozmej Thanks for the thoughtful take. The goal here isn’t performance; it’s to make the behavior fully deterministic and culture‑invariant across machines.
|
if (!fHas) | ||
{ | ||
if (sPos == -1) | ||
if (!sHas) | ||
{ | ||
return f.Name.CompareTo(s.Name); | ||
return string.Compare(f.Name, s.Name, StringComparison.OrdinalIgnoreCase); | ||
} | ||
|
||
return 1; | ||
} | ||
|
||
if (sPos == -1) | ||
if (!sHas) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw you didn't rename the usages of the flags.
@LukaszRozmej updated |
This somewhat conflicts with #9264, which we need to resolve first |
PluginLoader.OrderPlugins
with culture-invariant, deterministic comparisons.ToLower()
/CompareTo
with:StringComparer.OrdinalIgnoreCase
for the ordering mapstring.Compare(..., StringComparison.Ordinal)
for tie-break sortingorderMap
to avoid linearIndexOf
lookups.