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

src: remove redundant cast in string_search.h #26426

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/string_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ size_t StringSearch<Char>::BoyerMooreSearch(
// we have matched more than our tables allow us to be smart about.
// Fall back on BMH shift.
index += pattern_length - 1 -
CharOccurrence(bad_char_occurrence,
static_cast<Char>(last_char));
CharOccurrence(bad_char_occurrence, last_char);
} else {
int gs_shift = good_suffix_shift[j + 1];
int bc_occ = CharOccurrence(bad_char_occurrence, c);
Expand Down Expand Up @@ -446,7 +445,7 @@ size_t StringSearch<Char>::BoyerMooreHorspoolSearch(
Char last_char = pattern_[pattern_length - 1];
int last_char_shift =
pattern_length - 1 -
CharOccurrence(char_occurrences, static_cast<Char>(last_char));
CharOccurrence(char_occurrences, last_char);

// Perform search
size_t index = start_index; // No matches found prior to this index.
Expand Down