Skip to content

Commit fe7a98b

Browse files
committed
Enabled correct WeakReferenceMessenger path on .NET 5
1 parent bae1fb0 commit fe7a98b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Microsoft.Toolkit.Mvvm/Messaging/WeakReferenceMessenger.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
using System.Runtime.CompilerServices;
1010
using Microsoft.Collections.Extensions;
1111
using Microsoft.Toolkit.Mvvm.Messaging.Internals;
12-
#if NETSTANDARD2_1
13-
using RecipientsTable = System.Runtime.CompilerServices.ConditionalWeakTable<object, Microsoft.Collections.Extensions.IDictionarySlim>;
14-
#else
12+
#if NETSTANDARD2_0
1513
using RecipientsTable = Microsoft.Toolkit.Mvvm.Messaging.WeakReferenceMessenger.ConditionalWeakTable<object, Microsoft.Collections.Extensions.IDictionarySlim>;
14+
#else
15+
using RecipientsTable = System.Runtime.CompilerServices.ConditionalWeakTable<object, Microsoft.Collections.Extensions.IDictionarySlim>;
1616
#endif
1717

1818
namespace Microsoft.Toolkit.Mvvm.Messaging
@@ -288,7 +288,7 @@ public void Reset()
288288
}
289289
}
290290

291-
#if !NETSTANDARD2_1
291+
#if NETSTANDARD2_0
292292
/// <summary>
293293
/// A wrapper for <see cref="System.Runtime.CompilerServices.ConditionalWeakTable{TKey,TValue}"/>
294294
/// that backports the enumerable support to .NET Standard 2.0 through an auxiliary list.
@@ -470,7 +470,7 @@ private ref struct ArrayPoolBufferWriter<T>
470470
[MethodImpl(MethodImplOptions.AggressiveInlining)]
471471
public static ArrayPoolBufferWriter<T> Create()
472472
{
473-
return new ArrayPoolBufferWriter<T> { array = ArrayPool<T>.Shared.Rent(DefaultInitialBufferSize) };
473+
return new() { array = ArrayPool<T>.Shared.Rent(DefaultInitialBufferSize) };
474474
}
475475

476476
/// <summary>

0 commit comments

Comments
 (0)