-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix documentation for ReadOnlySequence.GetOffset #116524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the XML documentation for ReadOnlySequence.GetOffset to clarify that its returned offset is not zero-indexed.
- Removed explicit reference to “from the start” in the summary.
- Added a remarks section explaining how to adjust the offset to obtain a zero-indexed value.
Comments suppressed due to low confidence (1)
src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs:533
- The updated remarks clarify the non-zero indexing behavior; however, consider explicitly stating the indexing base or mentioning that this behavior is consistent with related APIs to avoid any ambiguity.
/// The returned offset is not zero indexed from the start.
Tagging subscribers to this area: @dotnet/area-system-memory |
src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs
Outdated
Show resolved
Hide resolved
Thank you, @lilinus; I'm sorry for the long delay getting to this review. You are correct that this will also need to be fixed in dotnet-api-docs, but merging here is helpful for our own reference within the codebase and keeps the docs in sync. I submitted dotnet/dotnet-api-docs#11755 for that. |
Fixes documentation for ReadOnlySequence.GetOffset to communicate that the returned value is not zero indexed.
Maybe this needs to be changed in https://github.com/dotnet/dotnet-api-docs too?
Related to #75866