Skip to content

Commit

Permalink
Change localedataprovider comparison to prevent false equivalences
Browse files Browse the repository at this point in the history
  • Loading branch information
Banane9 committed Mar 10, 2024
1 parent 518a7d7 commit ec6a611
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion MonkeyLoader.Resonite.Integration/LocaleDataInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using MonkeyLoader.Meta;
using MonkeyLoader.Patching;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
Expand Down Expand Up @@ -206,7 +207,14 @@ private static void LoadTargetVariantPrefix(LocaleResource __instance, ref bool
private sealed class LocaleDataProviderComparerImpl : IComparer<ILocaleDataProvider>
{
public int Compare(ILocaleDataProvider x, ILocaleDataProvider y)
=> x.Priority.CompareTo(y.Priority);
{
var priorityComparison = x.Priority.CompareTo(y.Priority);

if (priorityComparison != 0)
return priorityComparison;

return Comparer.DefaultInvariant.Compare(x, y);
}
}
}
}

0 comments on commit ec6a611

Please sign in to comment.