dotnet/runtime

ReadOnlySequence<T>.TryGet() returns empty result

Open

#27.769 aperta il 30 ott 2018

Vedi su GitHub
 (7 commenti) (0 reazioni) (0 assegnatari)C# (5445 fork)batch import
area-System.Memorybughelp wanted

Metriche repository

Star
 (17.886 star)
Metriche merge PR
 (Merge medio 12g 11h) (661 PR mergiate in 30 g)

Descrizione

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.

Guida contributor