|
1 | 1 | using System; |
2 | | -using System.Linq; |
3 | 2 | using System.Collections.Generic; |
4 | 3 | using System.IO; |
5 | | -using System.Reflection; |
6 | 4 | using System.Runtime.CompilerServices; |
7 | 5 | using System.Threading; |
8 | 6 | using ServiceStack.Text.Common; |
@@ -129,10 +127,6 @@ public static JsConfigScope CreateScope(string config, JsConfigScope scope = nul |
129 | 127 | case "includepublicfields": |
130 | 128 | scope.IncludePublicFields = boolValue; |
131 | 129 | break; |
132 | | - case "rsb": |
133 | | - case "reuseStringBuffer": |
134 | | - scope.ReuseStringBuffer = boolValue; |
135 | | - break; |
136 | 130 | case "dh": |
137 | 131 | case "datehandler": |
138 | 132 | switch (value) |
@@ -232,7 +226,6 @@ public static JsConfigScope With( |
232 | 226 | bool? appendUtcOffset = null, |
233 | 227 | bool? escapeUnicode = null, |
234 | 228 | bool? includePublicFields = null, |
235 | | - bool? reuseStringBuffer = null, |
236 | 229 | int? maxDepth = null, |
237 | 230 | EmptyCtorFactoryDelegate modelFactory = null, |
238 | 231 | string[] excludePropertyReferences = null) |
@@ -269,7 +262,6 @@ public static JsConfigScope With( |
269 | 262 | AppendUtcOffset = appendUtcOffset ?? sAppendUtcOffset, |
270 | 263 | EscapeUnicode = escapeUnicode ?? sEscapeUnicode, |
271 | 264 | IncludePublicFields = includePublicFields ?? sIncludePublicFields, |
272 | | - ReuseStringBuffer = reuseStringBuffer ?? sReuseStringBuffer, |
273 | 265 | MaxDepth = maxDepth ?? sMaxDepth, |
274 | 266 | ModelFactory = modelFactory ?? ModelFactory, |
275 | 267 | ExcludePropertyReferences = excludePropertyReferences ?? sExcludePropertyReferences |
@@ -829,25 +821,6 @@ public static bool IncludePublicFields |
829 | 821 | } |
830 | 822 | } |
831 | 823 |
|
832 | | - /// <summary> |
833 | | - /// For extra serialization performance you can re-use a ThreadStatic StringBuilder |
834 | | - /// when serializing to a JSON String. |
835 | | - /// </summary> |
836 | | - private static bool? sReuseStringBuffer; |
837 | | - public static bool ReuseStringBuffer |
838 | | - { |
839 | | - get |
840 | | - { |
841 | | - return (JsConfigScope.Current != null ? JsConfigScope.Current.ReuseStringBuffer : null) |
842 | | - ?? sReuseStringBuffer |
843 | | - ?? true; |
844 | | - } |
845 | | - set |
846 | | - { |
847 | | - if (!sReuseStringBuffer.HasValue) sReuseStringBuffer = value; |
848 | | - } |
849 | | - } |
850 | | - |
851 | 824 | /// <summary> |
852 | 825 | /// Sets the maximum depth to avoid circular dependencies |
853 | 826 | /// </summary> |
@@ -963,7 +936,6 @@ public static void Reset() |
963 | 936 | sEscapeUnicode = null; |
964 | 937 | sOnDeserializationError = null; |
965 | 938 | sIncludePublicFields = null; |
966 | | - sReuseStringBuffer = null; |
967 | 939 | HasSerializeFn = new HashSet<Type>(); |
968 | 940 | HasIncludeDefaultValue = new HashSet<Type>(); |
969 | 941 | TreatValueAsRefTypes = new HashSet<Type> { typeof(KeyValuePair<,>) }; |
|
0 commit comments