From 44f62607a1d4e499d53049f7971ccf1639bb7d9c Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Mon, 4 Mar 2019 22:52:06 +0800 Subject: [PATCH] src: remove redundant cast in string_search.h PR-URL: https://github.com/nodejs/node/pull/26426 Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- src/string_search.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/string_search.h b/src/string_search.h index 358a4c1b024e67..4929ccbcfd02fe 100644 --- a/src/string_search.h +++ b/src/string_search.h @@ -351,8 +351,7 @@ size_t StringSearch::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(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); @@ -449,7 +448,7 @@ size_t StringSearch::BoyerMooreHorspoolSearch( Char last_char = pattern_[pattern_length - 1]; int last_char_shift = pattern_length - 1 - - CharOccurrence(char_occurrences, static_cast(last_char)); + CharOccurrence(char_occurrences, last_char); // Perform search size_t index = start_index; // No matches found prior to this index.