Skip to content

Commit

Permalink
src: remove redundant cast in string_search.h
Browse files Browse the repository at this point in the history
PR-URL: #26426
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
gengjiawen authored and BethGriggs committed Apr 16, 2019
1 parent dc9f1c6 commit 44f6260
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/string_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,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 @@ -449,7 +448,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

0 comments on commit 44f6260

Please sign in to comment.