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 BridgeAR committed Mar 14, 2019
1 parent 2a2a4e6 commit 81c5382
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 @@ -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

0 comments on commit 81c5382

Please sign in to comment.