Open gfr-g opened 2 years ago
Tagging subscribers to this area: @dotnet/area-system-buffers See info in area-owners.md if you want to be subscribed.
Author: | gfr-g |
---|---|
Assignees: | adityamandaleeka |
Labels: | `area-System.Buffers`, `area-System.IO.Pipelines`, `investigate` |
Milestone: | 7.0.0 |
Tagging subscribers to this area: @dotnet/area-system-buffers See info in area-owners.md if you want to be subscribed.
Author: | gfr-g |
---|---|
Assignees: | adityamandaleeka |
Labels: | `area-System.Buffers`, `area-System.IO.Pipelines`, `investigate` |
Milestone: | 7.0.0 |
I think this is a read only sequence issue.
Is it possible to give a repro snippet that is only in terms of span/sequence and not pipes?
Tangentially related to https://github.com/dotnet/runtime/issues/30786
Is it possible to give a repro snippet that is only in terms of span/sequence and not pipes?
I updated the issue
Description
I'm not sure whether this is a bug or expected behavior but calling
ReadOnlySequence.Slice(int start, int length)
on a sequence with more than one segment with a start index of 0 and length equal to the size of the first segment, returns a sequence with two segments where the second one is empty (this actually happen for slices of any size, as long as they are on a segment border, and regardless of whether we start from the beginning of the first segment or the beginning of any other segment)Reproduction Steps
Expected behavior
When slicing a sequence on segments border, I expect to get a sequence which contains only the sliced segments.
Actual behavior
Currently, slicing as described adds an empty segment at the end of the sequence.
Regression?
No response
Known Workarounds
No response
Configuration
NET 6.0 (but I also tried with the latest 7.0 preview) Windows 10 x64
Other information
No response