Reduce enumerator overhead in `GameplayLeaderboard`

This commit is contained in:
Dean Herbert 2024-01-23 05:26:16 +09:00
parent 1cde18b895
commit 069af13aaf
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -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();
@ -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;

View File

@ -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;