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 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.