Skip to content

Commit a6e65e8

Browse files
fix: CI build errors + fourth-pass perf (IList cast, IDE0004/IDE0032, touch/hit-policy/relax/taiko allocs)
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/16daf401-e98b-42e6-8464-4745383d6e40 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 4d7aa83 commit a6e65e8

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public virtual void Play()
6868
if (nextObject == null)
6969
return;
7070

71-
// HitSampleInfo implements ISampleInfo, so array covariance lets us cast without
72-
// allocating a second array via .Cast<ISampleInfo>().ToArray().
73-
PlaySamples((ISampleInfo[])nextObject.Samples.ToArray());
71+
// HitSampleInfo : ISampleInfo (reference type) — array covariance makes the assignment
72+
// implicit; no explicit cast or second array allocation needed.
73+
PlaySamples(nextObject.Samples.ToArray());
7474
}
7575

7676
protected virtual void PlaySamples(ISampleInfo[] samples) => Schedule(() =>

osu.Game/Screens/OnlinePlay/Matchmaking/Queue/CloudVisualisation.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,27 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
2323
/// </summary>
2424
public partial class CloudVisualisation : CompositeDrawable
2525
{
26-
private APIUser[] users = [];
2726
private Container usersContainer = null!;
2827

2928
private readonly Bindable<double?> lastSamplePlayback = new Bindable<double?>();
3029

3130
public APIUser[] Users
3231
{
33-
get => users;
32+
get;
3433
set
3534
{
36-
users = value;
35+
field = value;
3736
if (IsLoaded)
3837
refresh();
3938
}
40-
}
39+
} = [];
4140

4241
private void refresh()
4342
{
4443
foreach (var u in usersContainer)
4544
u.Delay(RNG.Next(0, 1000)).FadeOut(500).Expire();
4645

47-
LoadComponentsAsync(users.Select(u => new MovingAvatar(u, lastSamplePlayback)), avatars =>
46+
LoadComponentsAsync(Users.Select(u => new MovingAvatar(u, lastSamplePlayback)), avatars =>
4847
{
4948
if (usersContainer.Count == 0)
5049
{

osu.Game/Screens/Select/BeatmapCarouselFilterSorting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private static int compareUsingAggregateMax(BeatmapInfo a, BeatmapInfo b, Func<B
155155
/// <paramref name="beatmaps"/>, or <see cref="double.NegativeInfinity"/> if every beatmap
156156
/// is hidden. Single-pass, allocation-free (no LINQ enumerator).
157157
/// </summary>
158-
private static double aggregateMax(IReadOnlyList<BeatmapInfo> beatmaps, Func<BeatmapInfo, double> func)
158+
private static double aggregateMax(IList<BeatmapInfo> beatmaps, Func<BeatmapInfo, double> func)
159159
{
160160
double max = double.NegativeInfinity;
161161

0 commit comments

Comments
 (0)