Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Always slice
  • Loading branch information
davidfowl committed Aug 23, 2021
commit c1a34264474082dde71e907ef612268f6da125ec
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public override async Task CopyToAsync(PipeWriter destination, CancellationToken
{
while (segment != null)
{
FlushResult flushResult = await destination.WriteAsync(segmentIndex > 0 ? segment.Memory.Slice(segmentIndex) : segment.Memory, tokenSource.Token).ConfigureAwait(false);
FlushResult flushResult = await destination.WriteAsync(segment.Memory.Slice(segmentIndex), tokenSource.Token).ConfigureAwait(false);

if (flushResult.IsCanceled)
{
Expand Down Expand Up @@ -460,7 +460,7 @@ public override async Task CopyToAsync(Stream destination, CancellationToken can
{
while (segment != null)
{
await destination.WriteAsync(segmentIndex > 0 ? segment.Memory.Slice(segmentIndex) : segment.Memory, tokenSource.Token).ConfigureAwait(false);
await destination.WriteAsync(segment.Memory.Slice(segmentIndex), tokenSource.Token).ConfigureAwait(false);

segment = segment.NextSegment;
segmentIndex = 0;
Expand Down