Skip to content

Commit

Permalink
Enabled correct WeakReferenceMessenger path on .NET 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Apr 16, 2021
1 parent bae1fb0 commit fe7a98b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Microsoft.Toolkit.Mvvm/Messaging/WeakReferenceMessenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
using System.Runtime.CompilerServices;
using Microsoft.Collections.Extensions;
using Microsoft.Toolkit.Mvvm.Messaging.Internals;
#if NETSTANDARD2_1
using RecipientsTable = System.Runtime.CompilerServices.ConditionalWeakTable<object, Microsoft.Collections.Extensions.IDictionarySlim>;
#else
#if NETSTANDARD2_0
using RecipientsTable = Microsoft.Toolkit.Mvvm.Messaging.WeakReferenceMessenger.ConditionalWeakTable<object, Microsoft.Collections.Extensions.IDictionarySlim>;
#else
using RecipientsTable = System.Runtime.CompilerServices.ConditionalWeakTable<object, Microsoft.Collections.Extensions.IDictionarySlim>;
#endif

namespace Microsoft.Toolkit.Mvvm.Messaging
Expand Down Expand Up @@ -288,7 +288,7 @@ public void Reset()
}
}

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

/// <summary>
Expand Down

0 comments on commit fe7a98b

Please sign in to comment.