Skip to content

Commit da7057f

Browse files
committed
fixup! feat(song-select): Add title as fallback for BPM sorting mode
1 parent c4f998c commit da7057f

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

osu.Game/Screens/Select/BeatmapCarouselFilterSorting.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ private static int compare(BeatmapInfo a, BeatmapInfo b, SortMode sort, bool agg
102102
comparison = compareUsingAggregateMax(a, b, static b => b.BPM);
103103
else
104104
comparison = a.BPM.CompareTo(b.BPM);
105+
if (comparison == 0)
106+
goto case SortMode.Title;
105107
break;
106108

107109
case SortMode.Length:
@@ -115,17 +117,6 @@ private static int compare(BeatmapInfo a, BeatmapInfo b, SortMode sort, bool agg
115117
throw new ArgumentOutOfRangeException();
116118
}
117119

118-
// For certain sort modes, use title comparison as a fallback
119-
// To begin with, I've only added the mode that concerns *me* but I'm sure there are more that could make use of this logic, down for you to decide which to add.
120-
if (comparison == 0 && new List<SortMode> { SortMode.BPM }.Contains(sort))
121-
{
122-
// Review: I'm not sure whether to duplicate the comparing logic for titles or introduce a recursive call.
123-
// We have the certainty that we won't go in an infinite recursion since the list in the if's condition excludes the mode that we're recursing on.
124-
125-
// comparison = OrdinalSortByCaseStringComparer.DEFAULT.Compare(a.BeatmapSet!.Metadata.Title, b.BeatmapSet!.Metadata.Title);
126-
comparison = compare(a, b, SortMode.Title, aggregate);
127-
}
128-
129120
// If the initial sort could not differentiate, attempt to use DateAdded to order sets in a stable fashion.
130121
// The directionality of this matches the current SortMode.DateAdded, but we may want to reconsider if that becomes a user decision (ie. asc / desc).
131122
if (comparison == 0)

0 commit comments

Comments
 (0)