Skip to content

Commit

Permalink
Remove long to int truncation of stream position
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Sep 27, 2023
1 parent ec99ca7 commit e9100a7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ private static T DeserializeFromSequenceAndRewindStreamIfPossible<T>(Stream stre
if (streamToRewind.CanSeek && !reader.End)
{
// Reverse the stream as many bytes as we left unread.
int bytesNotRead = checked((int)reader.Sequence.Slice(reader.Position).Length);
long bytesNotRead = reader.Sequence.Slice(reader.Position).Length;
streamToRewind.Seek(-bytesNotRead, SeekOrigin.Current);
}

Expand Down

0 comments on commit e9100a7

Please sign in to comment.