Open beetlex-io opened 1 month ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Tagging subscribers to this area: @dotnet/area-system-buffers See info in area-owners.md if you want to be subscribed.
Could this be a duplicate of #75866?
Maybe, use ReadOnlySequence.GetOffset(point) value does not change after the ReadOnlySequence.Slice method is called.
string name = "name:henryfan\r";
ReadOnlySequence<byte> sequence = new ReadOnlySequence<byte>(Encoding.UTF8.GetBytes(name));
var point = sequence.PositionOf((byte)'\r');
var index = sequence.GetOffset(point.Value);//return 13 right
sequence = sequence.Slice(2);
point = sequence.PositionOf((byte)'\r');
index = sequence.GetOffset(point.Value);//return 13 wrong
ReadOnlySequence.PositionOf fun return index larger than array length?
Test code:
Debug info:![image](https://github.com/dotnet/sdk/assets/2564178/df436246-293c-4d75-a8e2-7c32988765ed)