mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Use a more correct CompareTo
implementation for ruleset ordering
This commit is contained in:
@ -51,14 +51,14 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
public int CompareTo(RulesetInfo other)
|
public int CompareTo(RulesetInfo other)
|
||||||
{
|
{
|
||||||
|
if (OnlineID >= 0 && other.OnlineID >= 0)
|
||||||
|
return OnlineID.CompareTo(other.OnlineID);
|
||||||
|
|
||||||
// Official rulesets are always given precedence for the time being.
|
// Official rulesets are always given precedence for the time being.
|
||||||
if (OnlineID >= 0)
|
if (OnlineID >= 0)
|
||||||
{
|
|
||||||
if (other.OnlineID >= 0)
|
|
||||||
return OnlineID.CompareTo(other.OnlineID);
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
if (other.OnlineID >= 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
return string.Compare(ShortName, other.ShortName, StringComparison.Ordinal);
|
return string.Compare(ShortName, other.ShortName, StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user