Skip to content
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

Fix SearchValues<string>.Contains issue if one value is a prefix of all the others #91887

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

MihaZupan
Copy link
Member

We remove values that are suffixes of other values when constructing a SearchValues<string> instance.
If we're left with just one value, we'll use the single-value implementation, but we weren't accounting for values that may have been removed, and ContainsCore would return a false negative for such values.

@MihaZupan MihaZupan added this to the 9.0.0 milestone Sep 11, 2023
@MihaZupan MihaZupan self-assigned this Sep 11, 2023
@ghost
Copy link

ghost commented Sep 11, 2023

Tagging subscribers to this area: @dotnet/area-system-buffers
See info in area-owners.md if you want to be subscribed.

Issue Details

We remove values that are suffixes of other values when constructing a SearchValues<string> instance.
If we're left with just one value, we'll use the single-value implementation, but we weren't accounting for values that may have been removed, and ContainsCore would return a false negative for such values.

Author: MihaZupan
Assignees: MihaZupan
Labels:

area-System.Buffers

Milestone: 9.0.0

@MihaZupan MihaZupan merged commit d0dfe06 into dotnet:main Sep 11, 2023
168 of 170 checks passed
@ghost ghost locked as resolved and limited conversation to collaborators Oct 12, 2023
Sign up for free to 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.

2 participants