Skip to content

Commit

Permalink
Reduce enumerator overhead in GameplayLeaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jan 22, 2024
1 parent 1cde18b commit 069af13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions osu.Game/Online/Leaderboards/Leaderboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private void updateScoresDrawables()
double delay = 0;
foreach (var s in scoreFlowContainer.Children)
foreach (var s in scoreFlowContainer)
{
using (s.BeginDelayedSequence(delay))
s.Show();
Expand Down Expand Up @@ -384,7 +384,7 @@ protected override void UpdateAfterChildren()
if (scoreFlowContainer == null)
return;

foreach (var c in scoreFlowContainer.Children)
foreach (var c in scoreFlowContainer)
{
float topY = c.ToSpaceOfOtherDrawable(Vector2.Zero, scoreFlowContainer).Y;
float bottomY = topY + LeaderboardScore.HEIGHT;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/HUD/GameplayLeaderboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected override void Update()
if (!scroll.IsScrolledToEnd()) fadeBottom -= panel_height;

// logic is mostly shared with Leaderboard, copied here for simplicity.
foreach (var c in Flow.Children)
foreach (var c in Flow)
{
float topY = c.ToSpaceOfOtherDrawable(Vector2.Zero, Flow).Y;
float bottomY = topY + panel_height;
Expand Down

0 comments on commit 069af13

Please sign in to comment.