Add SpanSplitEnumerator.Source#113673
Merged
stephentoub merged 2 commits intodotnet:mainfrom Mar 19, 2025
Merged
Conversation
|
Note regarding the |
|
Note regarding the |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new property, Source, to the SpanSplitEnumerator struct to expose the source span for enumeration. The changes include:
- Adding the Source property in the ref assembly.
- Adding an assertion in tests to verify the Source property.
- Renaming internal fields and adjusting constructors in MemoryExtensions to use _source instead of _span.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/libraries/System.Memory/ref/System.Memory.cs | Added the public Source property to SpanSplitEnumerator. |
| src/libraries/System.Runtime/tests/System.Runtime.Tests/System/String.SplitTests.cs | Added an assertion to check the Source property in the test. |
| src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs | Renamed internal field _span to _source and updated constructors and comments accordingly. |
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
7c949e5 to
4af79fd
Compare
MihaZupan
approved these changes
Mar 18, 2025
bartonjs
reviewed
Mar 18, 2025
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/String.SplitTests.cs
Show resolved
Hide resolved
This was referenced Mar 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #109874