[webkit-reviews] review granted: [Bug 96028] equalIgnoringCase of two StringImpls doesn't handle 8 bit strings : [Attachment 162606] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 6 19:15:05 PDT 2012


Benjamin Poulain <benjamin at webkit.org> has granted Michael Saboff
<msaboff at apple.com>'s request for review:
Bug 96028: equalIgnoringCase of two StringImpls doesn't handle 8 bit strings
https://bugs.webkit.org/show_bug.cgi?id=96028

Attachment 162606: Patch
https://bugs.webkit.org/attachment.cgi?id=162606&action=review

------- Additional Comments from Benjamin Poulain <benjamin at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=162606&action=review


> Source/WTF/wtf/text/StringHash.h:66
> -	       if (b->is8Bit()) {
> -		   // We know that a is 8 bit and b is 16 bit.
> +	       if (b->is8Bit())
>		   return WTF::equal(a->characters16(), b->characters8(),
aLength);

Nice comment indeed :)

> Source/WTF/wtf/text/StringHash.h:135
>	       return WTF::Unicode::umemcasecmp(a->characters(),
b->characters(), length) == 0;

For clarity, I would also use equalIgnoringCase here.

And characters() could be characters16().


More information about the webkit-reviews mailing list