Skip to content

Commit 255fe9b

Browse files
committed
Attempt to fix strange compiler error
1 parent ce05128 commit 255fe9b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/DotNext.IO/IO/DecodingTextReader.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ private int ReadBuffer(Span<char> output)
4141
{
4242
var result = 0;
4343

44-
for (int bytesConsumed, charsProduced, maxBytes = encoding.GetMaxByteCount(output.Length);
45-
!sequence.IsEmpty && !output.IsEmpty;
46-
maxBytes -= bytesConsumed, result += charsProduced)
44+
for (var maxBytes = encoding.GetMaxByteCount(output.Length); !sequence.IsEmpty && !output.IsEmpty;)
4745
{
4846
var input = sequence.FirstSpan;
49-
decoder.Convert(input, output, maxBytes <= input.Length, out bytesConsumed, out charsProduced, out _);
47+
decoder.Convert(input, output, maxBytes <= input.Length, out var bytesConsumed, out var charsProduced, out _);
5048
sequence = sequence.Slice(bytesConsumed);
5149
output = output.Slice(charsProduced);
50+
51+
maxBytes -= bytesConsumed;
52+
result += charsProduced;
5253
}
5354

5455
return result;

0 commit comments

Comments
 (0)