[webkit-reviews] review granted: [Bug 73799] Update String::containsOnlyASCII() to handle 8 bits strings : [Attachment 117946] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Dec 5 15:22:13 PST 2011
Darin Adler <darin at apple.com> has granted Benjamin Poulain
<benjamin at webkit.org>'s request for review:
Bug 73799: Update String::containsOnlyASCII() to handle 8 bits strings
https://bugs.webkit.org/show_bug.cgi?id=73799
Attachment 117946: Patch
https://bugs.webkit.org/attachment.cgi?id=117946&action=review
------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=117946&action=review
> Source/JavaScriptCore/wtf/text/WTFString.h:492
> return !(ored & 0xFF80);
This is the only thing here that is specific to 2 bytes. It could be written
like this:
return !(ored & ~0x7F);
And then it would only require that CharType was the size of an integer or
smaller. Or it could be written like this:
CharType lowBits = 0x7F;
return !(ored & ~lowBits);
And then it would work with pretty much any type and a COMPILE_ASSERT would not
be needed.
More information about the webkit-reviews
mailing list