Revert "Added support for splitting on ReadOnlySpan<char> (#295)"#37757
Merged
layomia merged 1 commit intodotnet:masterfrom Jun 11, 2020
Merged
Revert "Added support for splitting on ReadOnlySpan<char> (#295)"#37757layomia merged 1 commit intodotnet:masterfrom
layomia merged 1 commit intodotnet:masterfrom
Conversation
This reverts commit 78ed8e8.
GrabYourPitchforks
approved these changes
Jun 11, 2020
Member
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.
This reverts commit 78ed8e8.
We need to consider having the
ReadOnlySpan<char>.Split()methods return a type other than the generic SpanSplitEnumerator. There are many pivots thatstring.Splithas that we probaly want to align with, and baking all the required logic in the genericSpanSplitEnumerator<T>type will negatively impact performance and make the implementation for other types, e.g.SpanSplitEnumerator<byte>unnecessarily bloated. See #37742 (comment) for more detail.We also want to avoid bugs being introduced if this implementation is used as a drop-in replacement for
string.Split, due to behavioral differences:string.Split(previously addressed by Align ROS.Split handling of zero-length target strings with String.Split #37742).Splitmethod should align withstring.Split()i.e., split on anything for whichchar.IsWhiteSpacereturns true, not just the whitespace character' '.Given this implementation and the highlighted takeaways, we'll be more informed when reviewing #934, and before settling on an implementation.
cc @bbartels