Skip to content

Commit 81c5382

Browse files
gengjiawenBridgeAR
authored andcommitted
src: remove redundant cast in string_search.h
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]>
1 parent 2a2a4e6 commit 81c5382

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: src/string_search.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ size_t StringSearch<Char>::BoyerMooreSearch(
348348
// we have matched more than our tables allow us to be smart about.
349349
// Fall back on BMH shift.
350350
index += pattern_length - 1 -
351-
CharOccurrence(bad_char_occurrence,
352-
static_cast<Char>(last_char));
351+
CharOccurrence(bad_char_occurrence, last_char);
353352
} else {
354353
int gs_shift = good_suffix_shift[j + 1];
355354
int bc_occ = CharOccurrence(bad_char_occurrence, c);
@@ -446,7 +445,7 @@ size_t StringSearch<Char>::BoyerMooreHorspoolSearch(
446445
Char last_char = pattern_[pattern_length - 1];
447446
int last_char_shift =
448447
pattern_length - 1 -
449-
CharOccurrence(char_occurrences, static_cast<Char>(last_char));
448+
CharOccurrence(char_occurrences, last_char);
450449

451450
// Perform search
452451
size_t index = start_index; // No matches found prior to this index.

0 commit comments

Comments
 (0)