Skip to content

StringSegment behavior - #55501

Merged
eerhardt merged 6 commits into
dotnet:mainfrom
hrrrrustic:StringSegmentBehavior
Jul 15, 2021
Merged

StringSegment behavior#55501
eerhardt merged 6 commits into
dotnet:mainfrom
hrrrrustic:StringSegmentBehavior

Conversation

@hrrrrustic

Copy link
Copy Markdown
Contributor

@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

fix #45021
fix #53727

Author:hrrrrustic
Assignees:-
Labels:

area-Extensions-Primitives

Milestone:-

@hrrrrustichrrrrustic changed the title String segment behaviorStringSegment behaviorJul 12, 2021
Comment threadsrc/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs Outdated
Comment threadsrc/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs Outdated
Comment threadsrc/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs Outdated
Comment threadsrc/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs Outdated
Co-authored-by: Günther Foidl <gue@korporal.at>
@GrabYourPitchforks

Copy link
Copy Markdown
Member

@maryamariyan You marked #45021 as up-for-grabs but never specified what you believe the correct behavior should be: consistently return -1 or consistently throw an exception.

/cc @halter73

@hrrrrustic

Copy link
Copy Markdown
ContributorAuthor

I guess -1 is the correct way as it described in all of this methods docs 😄

/// <returns>The zero-based index position of <paramref name="c"/> from the beginning of the <see cref="StringSegment"/> if that character is found, or -1 if it is not.</returns>

/// was found; -1 if no character in <paramref name="anyOf"/> was found.</returns>

/// <returns>The zero-based index position of value if that character is found, or -1 if it is not.</returns>

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good. @GrabYourPitchforks - any thoughts/concerns?

@eerhardt

Copy link
Copy Markdown
Member

Linq.Expression failures are #55536. Merging.

@eerhardt
eerhardt merged commit 188c270 into dotnet:mainJul 15, 2021
@eerhardt

Copy link
Copy Markdown
Member

Thanks @hrrrrustic for the contribution here!

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StringSegment IndexOf behavior StringSegment doesn't handle null buffers consistently

5 participants

@hrrrrustic@GrabYourPitchforks@eerhardt@gfoidl@maryamariyan