@@ -22,7 +22,7 @@ public sealed override string ConvertName(string name)
22
22
? ArrayPool < char > . Shared . Rent ( rentedBufferLength )
23
23
: null ;
24
24
25
- int resultLength = 0 ;
25
+ int resultUsedLength = 0 ;
26
26
Span < char > result = rentedBuffer is null
27
27
? stackalloc char [ JsonConstants . StackallocCharThreshold ]
28
28
: rentedBuffer ;
@@ -35,7 +35,7 @@ void ExpandBuffer(ref Span<char> result)
35
35
36
36
if ( rentedBuffer is not null )
37
37
{
38
- result . Slice ( 0 , resultLength ) . Clear ( ) ;
38
+ result . Slice ( 0 , resultUsedLength ) . Clear ( ) ;
39
39
ArrayPool < char > . Shared . Return ( rentedBuffer ) ;
40
40
}
41
41
@@ -53,9 +53,9 @@ void WriteWord(ReadOnlySpan<char> word, ref Span<char> result)
53
53
int written ;
54
54
while ( true )
55
55
{
56
- var destinationOffset = resultLength != 0
57
- ? resultLength + 1
58
- : resultLength ;
56
+ var destinationOffset = resultUsedLength != 0
57
+ ? resultUsedLength + 1
58
+ : resultUsedLength ;
59
59
60
60
if ( destinationOffset < result . Length )
61
61
{
@@ -74,13 +74,13 @@ void WriteWord(ReadOnlySpan<char> word, ref Span<char> result)
74
74
ExpandBuffer ( ref result ) ;
75
75
}
76
76
77
- if ( resultLength != 0 )
77
+ if ( resultUsedLength != 0 )
78
78
{
79
- result [ resultLength ] = _separator ;
80
- resultLength += 1 ;
79
+ result [ resultUsedLength ] = _separator ;
80
+ resultUsedLength += 1 ;
81
81
}
82
82
83
- resultLength += written ;
83
+ resultUsedLength += written ;
84
84
}
85
85
86
86
int first = 0 ;
@@ -143,11 +143,11 @@ void WriteWord(ReadOnlySpan<char> word, ref Span<char> result)
143
143
144
144
WriteWord ( chars . Slice ( first ) , ref result ) ;
145
145
146
- name = result . Slice ( 0 , resultLength ) . ToString ( ) ;
146
+ name = result . Slice ( 0 , resultUsedLength ) . ToString ( ) ;
147
147
148
148
if ( rentedBuffer is not null )
149
149
{
150
- result . Slice ( 0 , resultLength ) . Clear ( ) ;
150
+ result . Slice ( 0 , resultUsedLength ) . Clear ( ) ;
151
151
ArrayPool < char > . Shared . Return ( rentedBuffer ) ;
152
152
}
153
153
0 commit comments