ICU-21710 Additional clean up after removing BOYER_MOORE code from usearch.cpp #1830
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 PR is a follow-up to PR #1800 (which removed BOYER_MOORE dead code from usearch.cpp).
This PR contains additional clean-up.
Thanks to Andy for pointing out on the other PR that
initialize
andsetShiftTable
were still setting up Boyer-Moore related data. It turns out that we can we can completely remove the shift tables and related fields from the data structs, as well as remove thesetShiftTable
method.The creation of
UStringSearch
objects should be slightly faster now, as we no longer waste time computing the unused shift tables (which hashed the pattern collation elements).The
sizeof(UStringSearch)
is decreased from 5240 bytes to 3192 bytes (on x64), so this should help to reduce memory for applications that create many string search objects.Also added a test case for a pattern with only ignoreable CEs. The comments on
initialize
said: "If pattern has no non-ignorable ce, we return a illegal argument error". However, it actually does not set illegal argument error.Checklist