Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.

Don't store plural forms in search handlers cache - #8

Merged
Chouby merged 3 commits into
masterfrom
plural_forms
Dec 8, 2021
Merged

Don't store plural forms in search handlers cache#8
Chouby merged 3 commits into
masterfrom
plural_forms

Conversation

@Chouby

@Chouby Chouby commented Dec 8, 2021

Copy link
Copy Markdown

The searched key doesn't include the plural form. Only the context and the singular. It's thus easier to compare the searched string to the strings stored in the search handle $originals array if this array stores the strings without the plural form.

  • For the binary search, this avoids to check if we should use strncmp() or strcmp().
  • For the hash search, this allows to use a direct comparison instead of strncmp() (I was not 100% sure of the robustness of this comparison).

@Chouby Chouby added the enhancement New feature or request label Dec 8, 2021
@Chouby
Chouby merged commit 83d7109 into master Dec 8, 2021
@Chouby
Chouby deleted the plural_forms branch December 8, 2021 14:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant