Bug 76652 - CaseFoldingHash::hash() doesn't handle 8 bit strings directly
Summary: CaseFoldingHash::hash() doesn't handle 8 bit strings directly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-19 11:46 PST by Michael Saboff
Modified: 2012-01-30 11:09 PST (History)
0 users

See Also:


Attachments
Patch (1.18 KB, patch)
2012-01-19 15:10 PST, Michael Saboff
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>