Bug 76652

Summary: CaseFoldingHash::hash() doesn't handle 8 bit strings directly
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch kling: review+

Description Michael Saboff 2012-01-19 11:46:15 PST
CaseFoldingHash::hash(StringImpl* str) should have a path for 8 bit strings.
Comment 1 Michael Saboff 2012-01-19 15:10:38 PST
Created attachment 123205 [details]
Patch
Comment 2 Andreas Kling 2012-01-19 15:29:48 PST
Comment on attachment 123205 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=123205&action=review

r=me, just one little thing:

> Source/JavaScriptCore/wtf/text/StringHash.h:105
>              return hash(str->characters(), str->length());

You should switch this to characters16() to avoid the extra is8Bit() check in StringImpl::characters().
Comment 3 Michael Saboff 2012-01-19 15:31:13 PST
(In reply to comment #2)
> (From update of attachment 123205 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=123205&action=review
> 
> r=me, just one little thing:
> 
> > Source/JavaScriptCore/wtf/text/StringHash.h:105
> >              return hash(str->characters(), str->length());
> 
> You should switch this to characters16() to avoid the extra is8Bit() check in StringImpl::characters().

Thanks for catching that.  I'll make the change before checking in.
Comment 4 Michael Saboff 2012-01-30 11:09:39 PST
Committed r106260: <http://trac.webkit.org/changeset/106260>