Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ReadOnlyMemory<char> switched to String/ReadOnlySpan<char> #11

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

akade
Copy link
Owner

@akade akade commented Oct 24, 2022

This PR switches from ReadOnlyMemory<char> to String / ReadOnlySpan<char> for FullText & Prefixindices. This is a breaking change.

The motivation for the breaking change is simplicity and having an intuitive interface. And in hindsight, using ReadOnlyMemory<char> can be considered premature optimization. Adding that almost all usages just pass in a string with .AsMemory() anyway, it makes no sense in keeping that.

How to update

  • Remove all usages .AsMemory(). Make sure to do that while building the sets as well as when querying. You can use this PR as a guideline.
  • If you passed in a "real" sliced ReadOnlyMemory<char> you’ll need to convert it. For creating (and naming) an index, using a static method is recommended. For query parameters, you can just call .ToString() on it to obtain a string.

@akade akade merged commit 2d47bb1 into main Oct 27, 2022
@akade akade deleted the feature/string-indices-consolidation branch October 27, 2022 15:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant