From bcd96b874409d19ad9c37944d2965548b41e647a Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 16 Mar 2017 21:07:25 +1300 Subject: [PATCH] -Cleanup --- Src/Newtonsoft.Json/Utilities/AsyncUtils.cs | 6 ------ .../Utilities/DynamicReflectionDelegateFactory.cs | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Src/Newtonsoft.Json/Utilities/AsyncUtils.cs b/Src/Newtonsoft.Json/Utilities/AsyncUtils.cs index 39e57e45..c5d2be0b 100644 --- a/Src/Newtonsoft.Json/Utilities/AsyncUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/AsyncUtils.cs @@ -81,12 +81,6 @@ namespace Newtonsoft.Json.Utilities return cancellationToken.IsCancellationRequested ? FromCanceled(cancellationToken) : writer.WriteAsync(value); } - public static Task WriteAsync(this TextWriter writer, char[] value, CancellationToken cancellationToken) - { - Debug.Assert(writer != null); - return cancellationToken.IsCancellationRequested ? FromCanceled(cancellationToken) : writer.WriteAsync(value); - } - public static Task WriteAsync(this TextWriter writer, char[] value, int start, int count, CancellationToken cancellationToken) { Debug.Assert(writer != null); diff --git a/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs b/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs index dd11a8bd..6da17b37 100644 --- a/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs +++ b/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs @@ -38,7 +38,12 @@ namespace Newtonsoft.Json.Utilities { internal class DynamicReflectionDelegateFactory : ReflectionDelegateFactory { - public static DynamicReflectionDelegateFactory Instance = new DynamicReflectionDelegateFactory(); + private static readonly DynamicReflectionDelegateFactory _instance = new DynamicReflectionDelegateFactory(); + + internal static DynamicReflectionDelegateFactory Instance + { + get { return _instance; } + } private static DynamicMethod CreateDynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner) {