Skip to content

Commit 07f1a27

Browse files
committed
Minor code tweak
1 parent ee1d768 commit 07f1a27

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Microsoft.Toolkit.Mvvm/Messaging/StrongReferenceMessenger.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,6 @@ public TMessage Send<TMessage, TToken>(TMessage message, TToken token)
371371
// that doesn't expose the single standard Current property.
372372
while (mappingEnumerator.MoveNext())
373373
{
374-
object recipient = mappingEnumerator.Key.Target;
375-
376374
// Pick the target handler, if the token is a match for the recipient
377375
if (mappingEnumerator.Value.TryGetValue(token, out object? handler))
378376
{
@@ -382,7 +380,7 @@ public TMessage Send<TMessage, TToken>(TMessage message, TToken token)
382380
// We're still using a checked span accesses here though to make sure an out of
383381
// bounds write can never happen even if an error was present in the logic above.
384382
pairs[2 * i] = handler!;
385-
pairs[(2 * i) + 1] = recipient;
383+
pairs[(2 * i) + 1] = mappingEnumerator.Key.Target;
386384
i++;
387385
}
388386
}

0 commit comments

Comments
 (0)