Skip to content

Commit

Permalink
chore: Simplify for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Nov 26, 2024
1 parent f2ee537 commit 63ddc19
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Uno.UWP/UI/Core/WeakEventHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,11 @@ private bool Trim()
{
lock (_lock)
{
for (int i = 0; i < _handlers.Count; i++)
for (int i = _handlers.Count - 1; i >= 0; i--)
{
if (!_handlers[i].Target.IsAlive)
{
_handlers.RemoveAt(i);
i--;
}
}

Expand Down

0 comments on commit 63ddc19

Please sign in to comment.