LGTM. On Thu, Sep 30, 2010 at 4:27 PM, <[email protected]> wrote:
> Reviewers: Kevin Millikin, > > Description: > Fix bad cast in string-search.h. > > Please review this at http://codereview.chromium.org/3530004/show > > Affected files: > M src/string-search.h > > > Index: src/string-search.h > diff --git a/src/string-search.h b/src/string-search.h > index > 4412e32ed3d735c61818fa4bcd901f11e94fff0c..eac84757ecf1d45458133442c5cfc200627cd691 > 100644 > --- a/src/string-search.h > +++ b/src/string-search.h > @@ -170,12 +170,12 @@ class StringSearch : private StringSearchBase { > return bad_char_occurrence[static_cast<int>(char_code)]; > } > if (sizeof(PatternChar) == 1) { > - if (static_cast<unsigned char>(char_code) > > String::kMaxAsciiCharCode) { > + if (static_cast<unsigned int>(char_code) > > String::kMaxAsciiCharCodeU) { > return -1; > } > - return bad_char_occurrence[static_cast<int>(char_code)]; > + return bad_char_occurrence[static_cast<unsigned int>(char_code)]; > } > - // Reduce to equivalence class. > + // Both pattern and subject are UC16. Reduce character to equivalence > class. > int equiv_class = char_code % kUC16AlphabetSize; > return bad_char_occurrence[equiv_class]; > } > > > -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
