Skip to content

Commit

Permalink
there is no need to set the Length since we are now tracking the offs…
Browse files Browse the repository at this point in the history
…et in memory
  • Loading branch information
adamsitnik committed Mar 5, 2021
1 parent 91423fa commit a7ca4cb
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,6 @@ private unsafe Task WriteAsyncInternalCore(ReadOnlyMemory<byte> source, Cancella
long positionBefore = _filePosition;
if (CanSeek)
{
// Make sure we set the length of the file appropriately.
long len = Length;

if (positionBefore + source.Length > len)
{
SetLengthCore(positionBefore + source.Length);
}

// Now set the position to read from in the NativeOverlapped struct
// For pipes, we should leave the offset fields set to 0.
intOverlapped->OffsetLow = (int)positionBefore;
Expand Down

0 comments on commit a7ca4cb

Please sign in to comment.