dotnet/runtime

ReadOnlySequence<T>.TryGet() returns empty result

Open

#27,769 opened on Oct 30, 2018

View on GitHub
 (7 comments) (0 reactions) (0 assignees)C# (5,445 forks)batch import
area-System.Memorybughelp wanted

Repository metrics

Stars
 (17,886 stars)
PR merge metrics
 (Avg merge 12d 11h) (661 merged PRs in 30d)

Description

When calling ReadOnlySequence<T>.TryGet(ref position, out memory) with a position of sequence.End or sequence.GetPosition(size) the result is true and memory is an empty slice. As this effectively is not returning a segment or byte, is should probably return false.

As per this comment from @pakrym, I'm raising as a seperate issue.

Contributor guide