WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-140858-20150124112757.patch (text/plain), 2.11 KB, created by
Chris Dumez
on 2015-01-24 11:27:56 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2015-01-24 11:27:56 PST
Size:
2.11 KB
patch
obsolete
>Subversion Revision: 179061 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index f8b9597298239b2cf862c5626a31f22ef8846373..50fe0f82eb47177b05e553b47780841aa6286f1d 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,5 +1,21 @@ > 2015-01-24 Chris Dumez <cdumez@apple.com> > >+ Provide more efficient implementation for WTF::DefaultHash<bool> >+ https://bugs.webkit.org/show_bug.cgi?id=140858 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Provide more efficient implementation for WTF::DefaultHash<bool>. >+ Previously, it was merely calling intHash(uint8_t) which was a bit >+ wasteful. The new intHash(bool) returns the same result as >+ intHash(uint8_t) for boolean input values but with a lot less >+ manipulations. >+ >+ * wtf/HashFunctions.h: >+ (WTF::intHash): >+ >+2015-01-24 Chris Dumez <cdumez@apple.com> >+ > Provide implementation for WTF::DefaultHash<bool> > https://bugs.webkit.org/show_bug.cgi?id=140848 > >diff --git a/Source/WTF/wtf/HashFunctions.h b/Source/WTF/wtf/HashFunctions.h >index c4097adafd48fc849224ec4af8590f7c04506306..d9dd8cd0190c72627e9f936fa120573a2a860cdc 100644 >--- a/Source/WTF/wtf/HashFunctions.h >+++ b/Source/WTF/wtf/HashFunctions.h >@@ -35,6 +35,12 @@ namespace WTF { > > // integer hash function > >+ // Simplified version of intHash for boolean input, returning the same result. >+ inline unsigned intHash(bool key1) >+ { >+ return key1 ? 0x62baf5a0 : 0x4636b9c9; >+ } >+ > // Thomas Wang's 32 Bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm > inline unsigned intHash(uint8_t key8) > { >@@ -173,7 +179,7 @@ namespace WTF { > > // make IntHash the default hash function for many integer types > >- template<> struct DefaultHash<bool> { typedef IntHash<uint8_t> Hash; }; >+ template<> struct DefaultHash<bool> { typedef IntHash<bool> Hash; }; > template<> struct DefaultHash<short> { typedef IntHash<unsigned> Hash; }; > template<> struct DefaultHash<unsigned short> { typedef IntHash<unsigned> Hash; }; > template<> struct DefaultHash<int> { typedef IntHash<unsigned> Hash; };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
darin
:
review-
darin
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 140858
: 245287