RESOLVED FIXED 140848
Provide implementation for WTF::DefaultHash<bool>
https://bugs.webkit.org/show_bug.cgi?id=140848
Summary Provide implementation for WTF::DefaultHash<bool>
Chris Dumez
Reported 2015-01-23 16:37:51 PST
Provide implementation for WTF::DefaultHash<bool> so that we can use HashMap<std::pair<XXX, bool>> in the code base. Right now, the code has to use an integer type instead of a bool in the HashMap / HashSet to work around the issue.
Attachments
Patch (3.52 KB, patch)
2015-01-23 16:46 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2015-01-23 16:46:11 PST
WebKit Commit Bot
Comment 2 2015-01-23 16:48:42 PST
Attachment 245259 [details] did not pass style-queue: ERROR: Source/WTF/wtf/HashFunctions.h:176: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3 2015-01-24 07:57:57 PST
Comment on attachment 245259 [details] Patch Do we really want to take a single bit and run the intHash(uint8_t) function on it? Any of these might be better, and would give the same result: inline unsigned intHash(bool key) { return key ? 0x62BAF5A0 : 0x4636B9C9; } inline unsigned intHash(bool key) { return 0x4636B9C9 + key * 0x1C843BD7; } inline unsigned intHash(bool key) { return 0x4636B9C9 + (((key << 30) - key) & 0x1C843BD7); }
WebKit Commit Bot
Comment 4 2015-01-24 08:28:18 PST
Comment on attachment 245259 [details] Patch Clearing flags on attachment: 245259 Committed r179061: <http://trac.webkit.org/changeset/179061>
WebKit Commit Bot
Comment 5 2015-01-24 08:28:23 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.