Title: [244489] trunk/Source/WTF
Revision
244489
Author
[email protected]
Date
2019-04-20 12:16:22 -0700 (Sat, 20 Apr 2019)

Log Message

HashTable::removeIf always shrinks the hash table by half even if there is nothing left
https://bugs.webkit.org/show_bug.cgi?id=196681
<rdar://problem/49917764>

Reviewed by Darin Adler.

Address Darin's comments by removing the explicit type from std::max.

* wtf/HashTable.h:
(WTF::KeyTraits>::computeBestTableSize):
(WTF::KeyTraits>::shrinkToBestSize):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (244488 => 244489)


--- trunk/Source/WTF/ChangeLog	2019-04-20 19:00:15 UTC (rev 244488)
+++ trunk/Source/WTF/ChangeLog	2019-04-20 19:16:22 UTC (rev 244489)
@@ -1,3 +1,17 @@
+2019-04-19  Ryosuke Niwa  <[email protected]>
+
+        HashTable::removeIf always shrinks the hash table by half even if there is nothing left
+        https://bugs.webkit.org/show_bug.cgi?id=196681
+        <rdar://problem/49917764>
+
+        Reviewed by Darin Adler.
+
+        Address Darin's comments by removing the explicit type from std::max.
+
+        * wtf/HashTable.h:
+        (WTF::KeyTraits>::computeBestTableSize):
+        (WTF::KeyTraits>::shrinkToBestSize):
+
 2019-04-18  Chris Dumez  <[email protected]>
 
         [iOS] Improve detection of when web views go to background / foreground

Modified: trunk/Source/WTF/wtf/HashTable.h (244488 => 244489)


--- trunk/Source/WTF/wtf/HashTable.h	2019-04-20 19:00:15 UTC (rev 244488)
+++ trunk/Source/WTF/wtf/HashTable.h	2019-04-20 19:16:22 UTC (rev 244489)
@@ -1210,7 +1210,7 @@
             bestTableSize *= 2;
 
         unsigned minimumTableSize = KeyTraits::minimumTableSize;
-        return std::max<unsigned>(bestTableSize, minimumTableSize);
+        return std::max(bestTableSize, minimumTableSize);
     }
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
@@ -1217,7 +1217,7 @@
     void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::shrinkToBestSize()
     {
         unsigned minimumTableSize = KeyTraits::minimumTableSize;
-        rehash(std::max<unsigned>(minimumTableSize, computeBestTableSize(m_keyCount)), nullptr);
+        rehash(std::max(minimumTableSize, computeBestTableSize(m_keyCount)), nullptr);
     }
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to