@@ -14,8 +14,8 @@ public static bool TryGetUnescapedBase64Bytes(ReadOnlySpan<byte> utf8Source, int
14
14
{
15
15
byte [ ] ? unescapedArray = null ;
16
16
17
- Span < byte > utf8Unescaped = utf8Source . Length <= JsonConstants . StackallocThreshold ?
18
- stackalloc byte [ JsonConstants . StackallocThreshold ] :
17
+ Span < byte > utf8Unescaped = utf8Source . Length <= JsonConstants . StackallocByteThreshold ?
18
+ stackalloc byte [ JsonConstants . StackallocByteThreshold ] :
19
19
( unescapedArray = ArrayPool < byte > . Shared . Rent ( utf8Source . Length ) ) ;
20
20
21
21
Unescape ( utf8Source , utf8Unescaped , idx , out int written ) ;
@@ -44,8 +44,8 @@ public static string GetUnescapedString(ReadOnlySpan<byte> utf8Source, int idx)
44
44
int length = utf8Source . Length ;
45
45
byte [ ] ? pooledName = null ;
46
46
47
- Span < byte > utf8Unescaped = length <= JsonConstants . StackallocThreshold ?
48
- stackalloc byte [ JsonConstants . StackallocThreshold ] :
47
+ Span < byte > utf8Unescaped = length <= JsonConstants . StackallocByteThreshold ?
48
+ stackalloc byte [ JsonConstants . StackallocByteThreshold ] :
49
49
( pooledName = ArrayPool < byte > . Shared . Rent ( length ) ) ;
50
50
51
51
Unescape ( utf8Source , utf8Unescaped , idx , out int written ) ;
@@ -71,8 +71,8 @@ public static ReadOnlySpan<byte> GetUnescapedSpan(ReadOnlySpan<byte> utf8Source,
71
71
int length = utf8Source . Length ;
72
72
byte [ ] ? pooledName = null ;
73
73
74
- Span < byte > utf8Unescaped = length <= JsonConstants . StackallocThreshold ?
75
- stackalloc byte [ JsonConstants . StackallocThreshold ] :
74
+ Span < byte > utf8Unescaped = length <= JsonConstants . StackallocByteThreshold ?
75
+ stackalloc byte [ JsonConstants . StackallocByteThreshold ] :
76
76
( pooledName = ArrayPool < byte > . Shared . Rent ( length ) ) ;
77
77
78
78
Unescape ( utf8Source , utf8Unescaped , idx , out int written ) ;
@@ -96,8 +96,8 @@ public static bool UnescapeAndCompare(ReadOnlySpan<byte> utf8Source, ReadOnlySpa
96
96
97
97
byte [ ] ? unescapedArray = null ;
98
98
99
- Span < byte > utf8Unescaped = utf8Source . Length <= JsonConstants . StackallocThreshold ?
100
- stackalloc byte [ JsonConstants . StackallocThreshold ] :
99
+ Span < byte > utf8Unescaped = utf8Source . Length <= JsonConstants . StackallocByteThreshold ?
100
+ stackalloc byte [ JsonConstants . StackallocByteThreshold ] :
101
101
( unescapedArray = ArrayPool < byte > . Shared . Rent ( utf8Source . Length ) ) ;
102
102
103
103
Unescape ( utf8Source , utf8Unescaped , 0 , out int written ) ;
@@ -127,12 +127,12 @@ public static bool UnescapeAndCompare(ReadOnlySequence<byte> utf8Source, ReadOnl
127
127
128
128
int length = checked ( ( int ) utf8Source . Length ) ;
129
129
130
- Span < byte > utf8Unescaped = length <= JsonConstants . StackallocThreshold ?
131
- stackalloc byte [ JsonConstants . StackallocThreshold ] :
130
+ Span < byte > utf8Unescaped = length <= JsonConstants . StackallocByteThreshold ?
131
+ stackalloc byte [ JsonConstants . StackallocByteThreshold ] :
132
132
( unescapedArray = ArrayPool < byte > . Shared . Rent ( length ) ) ;
133
133
134
- Span < byte > utf8Escaped = length <= JsonConstants . StackallocThreshold ?
135
- stackalloc byte [ JsonConstants . StackallocThreshold ] :
134
+ Span < byte > utf8Escaped = length <= JsonConstants . StackallocByteThreshold ?
135
+ stackalloc byte [ JsonConstants . StackallocByteThreshold ] :
136
136
( escapedArray = ArrayPool < byte > . Shared . Rent ( length ) ) ;
137
137
138
138
utf8Source . CopyTo ( utf8Escaped ) ;
@@ -174,8 +174,8 @@ public static bool TryDecodeBase64(ReadOnlySpan<byte> utf8Unescaped, [NotNullWhe
174
174
{
175
175
byte [ ] ? pooledArray = null ;
176
176
177
- Span < byte > byteSpan = utf8Unescaped . Length <= JsonConstants . StackallocThreshold ?
178
- stackalloc byte [ JsonConstants . StackallocThreshold ] :
177
+ Span < byte > byteSpan = utf8Unescaped . Length <= JsonConstants . StackallocByteThreshold ?
178
+ stackalloc byte [ JsonConstants . StackallocByteThreshold ] :
179
179
( pooledArray = ArrayPool < byte > . Shared . Rent ( utf8Unescaped . Length ) ) ;
180
180
181
181
OperationStatus status = Base64 . DecodeFromUtf8 ( utf8Unescaped , byteSpan , out int bytesConsumed , out int bytesWritten ) ;
0 commit comments