fix queue converter singleton initialization (#56081)
authorEirik Tsarpalis <eirik.tsarpalis@gmail.com>
Thu, 22 Jul 2021 20:29:00 +0000 (23:29 +0300)
committerGitHub <noreply@github.com>
Thu, 22 Jul 2021 20:29:00 +0000 (21:29 +0100)
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs

index e0c8b0c..84873d1 100644 (file)
@@ -10,7 +10,7 @@ namespace System.Text.Json.Serialization.Converters
         where TCollection : Queue<TElement>
     {
         /// <summary>Lazily initialized singleton for hardcoding by the IAsyncEnumerable streaming deserializer.</summary>
-        internal static QueueOfTConverter<TCollection, TElement> Instance = _instance ??= new();
+        internal static QueueOfTConverter<TCollection, TElement> Instance => _instance ??= new();
         private static QueueOfTConverter<TCollection, TElement>? _instance;
 
         protected override void Add(in TElement value, ref ReadStack state)