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 <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • 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.