From fbb51f3050d18dcb37f6d1db48147b322776dbec Mon Sep 17 00:00:00 2001 From: Linus Hamlin <78953007+lilinus@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:10:39 +0200 Subject: [PATCH 1/2] Update ReadOnlySequence.cs --- .../System.Memory/src/System/Buffers/ReadOnlySequence.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs b/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs index ab91256f3add1d..927cb66a3d3c39 100644 --- a/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs +++ b/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs @@ -524,11 +524,15 @@ public SequencePosition GetPosition(long offset) } /// - /// Returns the offset of a within this sequence from the start. + /// Returns the offset of a within this sequence. /// /// The of which to get the offset. - /// The offset from the start of the sequence. + /// The offset in the sequence. /// The position is out of range. + /// + /// The returned offset is not zero indexed from the start. + /// Subtract mySequence.GetOffset(mySequence.Start) from the returned offset to obtain the zero indexed offset. + /// public long GetOffset(SequencePosition position) { object? positionSequenceObject = position.GetObject(); From 9094a1c39e40e6d75594181ff1a308cf66389d5c Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Mon, 1 Sep 2025 14:02:42 -0700 Subject: [PATCH 2/2] Tweak index verbiage for consistency with other docs --- .../System.Memory/src/System/Buffers/ReadOnlySequence.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs b/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs index 927cb66a3d3c39..d1a2a930ef9daf 100644 --- a/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs +++ b/src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs @@ -530,8 +530,8 @@ public SequencePosition GetPosition(long offset) /// The offset in the sequence. /// The position is out of range. /// - /// The returned offset is not zero indexed from the start. - /// Subtract mySequence.GetOffset(mySequence.Start) from the returned offset to obtain the zero indexed offset. + /// The returned offset is not a zero-based index from the start. + /// Subtract mySequence.GetOffset(mySequence.Start) from the returned offset to obtain the zero-based index offset. /// public long GetOffset(SequencePosition position) {