@@ -111,6 +111,7 @@ public static void WriteString(TextWriter writer, string value)
111
111
writer . Write ( QuoteChar ) ;
112
112
}
113
113
114
+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
114
115
private static bool IsPrintable ( this char c )
115
116
{
116
117
return c >= 32 && c <= 126 ;
@@ -128,6 +129,7 @@ private static bool IsPrintable(this char c)
128
129
/// TODO: Possible Linq-only solution requires profiling: return value.Any(c => !c.IsPrintable() || c == QuoteChar || c == EscapeChar);
129
130
/// </remarks>
130
131
private static bool HasAnyEscapeChars ( string value )
132
+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
131
133
{
132
134
var len = value . Length ;
133
135
for ( var i = 0 ; i < len ; i++ )
@@ -142,6 +144,7 @@ private static bool HasAnyEscapeChars(string value)
142
144
}
143
145
144
146
// Micro optimized
147
+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
145
148
public static void IntToHex ( int intValue , char [ ] hex )
146
149
{
147
150
// TODO: test if unrolling loop is faster
@@ -157,13 +160,15 @@ public static void IntToHex(int intValue, char[] hex)
157
160
}
158
161
}
159
162
163
+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
160
164
public static bool IsJsObject ( string value )
161
165
{
162
166
return ! string . IsNullOrEmpty ( value )
163
167
&& value [ 0 ] == '{'
164
168
&& value [ value . Length - 1 ] == '}' ;
165
169
}
166
170
171
+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
167
172
public static bool IsJsArray ( string value )
168
173
{
169
174
return ! string . IsNullOrEmpty ( value )
0 commit comments