[webkit-reviews] review denied: [Bug 95706] equal() in CSSParser.cpp should check the length of characters : [Attachment 161962] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 4 09:12:27 PDT 2012
Michael Saboff <msaboff at apple.com> has denied Kenichi Ishibashi
<bashi at chromium.org>'s request for review:
Bug 95706: equal() in CSSParser.cpp should check the length of characters
https://bugs.webkit.org/show_bug.cgi?id=95706
Attachment 161962: Patch
https://bugs.webkit.org/attachment.cgi?id=161962&action=review
------- Additional Comments from Michael Saboff <msaboff at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=161962&action=review
I'll code up the suggested changes and post.
> Source/WebCore/css/CSSParser.cpp:162
> + return a.is8Bit() ? WTF::equal(a.characters8(), reinterpret_cast<const
LChar*>(b), min(a.length(), N)) : WTF::equal(a.characters16(),
reinterpret_cast<const LChar*>(b), min(a.length(), N));
Instead of using min, an inline check for a.length() == N before the call to
WTF::equal() would be more efficient.
> Source/WebCore/css/CSSParser.cpp:168
> + return a.is8Bit() ? WTF::equalIgnoringCase(b, a.characters8(), max(N,
a.length())) : WTF::equalIgnoringCase(b, a.characters16(), max(N, a.length()));
Ditto.
More information about the webkit-reviews
mailing list