We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72dec0b commit fea5ce0Copy full SHA for fea5ce0
src/DotNext/Buffers/BufferWriterSlim.cs
@@ -313,23 +313,24 @@ public MemoryOwner<T> DetachOrCopyBuffer()
313
if (position is 0)
314
{
315
result = default;
316
- goto exit;
317
- }
318
- else if (NoOverflow)
319
- {
320
- result = allocator.AllocateExactly(position);
321
- initialBuffer.CopyTo(result.Span);
322
}
323
else
324
325
- result = extraBuffer;
326
- extraBuffer = default;
327
+ if (NoOverflow)
+ {
+ result = allocator.AllocateExactly(position);
+ initialBuffer.CopyTo(result.Span);
+ }
+ else
+ result = extraBuffer;
+ extraBuffer = default;
328
329
- result.Truncate(position);
330
- position = 0;
+ result.Truncate(position);
331
+ position = 0;
332
333
- exit:
334
return result;
335
336
0 commit comments