Changeset 194213 in webkit
- Timestamp:
- Dec 16, 2015 11:49:45 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r194210 r194213 1 2015-12-16 Alex Christensen <achristensen@webkit.org> 2 3 Make SessionID use intHash 4 https://bugs.webkit.org/show_bug.cgi?id=152356 5 6 Reviewed by Darin Adler. 7 8 * page/SessionID.h: 9 (WTF::SessionIDHash::hash): 10 (WTF::SessionIDHash::equal): 11 (WTF::HashTraits<WebCore::SessionID>::emptyValue): 12 (WTF::HashTraits<WebCore::SessionID>::constructDeletedValue): 13 (WTF::HashTraits<WebCore::SessionID>::isDeletedValue): 14 Use intHash instead of just casting a uint64_t to an unsigned. 15 This reduces hash collisions in HashTables that are usually quite small so it isn't much of a problem. 16 Also, needsDestruction hasn't been in HashTraits since r156507. 17 1 18 2015-12-16 Simon Fraser <simon.fraser@apple.com> 2 19 -
trunk/Source/WebCore/page/SessionID.h
r177692 r194213 57 57 // The empty value is emptySessionID(), the deleted value is (-1) 58 58 struct SessionIDHash { 59 static unsigned hash(const WebCore::SessionID& p) { return (unsigned)p.sessionID(); }59 static unsigned hash(const WebCore::SessionID& p) { return intHash(p.sessionID()); } 60 60 static bool equal(const WebCore::SessionID& a, const WebCore::SessionID& b) { return a == b; } 61 61 static const bool safeToCompareToEmptyOrDeleted = true; 62 62 }; 63 63 template<> struct HashTraits<WebCore::SessionID> : GenericHashTraits<WebCore::SessionID> { 64 static const uint64_t deletedValueIdentifier = 0xffffffffffffffff; 65 static const bool needsDestruction = false; 64 static const uint64_t deletedValueIdentifier = std::numeric_limits<uint64_t>::max(); 66 65 static WebCore::SessionID emptyValue() { return WebCore::SessionID::emptySessionID(); } 67 66
Note: See TracChangeset
for help on using the changeset viewer.