Title: [95090] trunk/Source/_javascript_Core
Revision
95090
Author
stevebl...@google.com
Date
2011-09-14 07:20:45 -0700 (Wed, 14 Sep 2011)

Log Message

HashTraits.h should include template specialization for WTF::String
https://bugs.webkit.org/show_bug.cgi?id=67851

Ensure that the template specialization for HashTraits<String> is always
picked up. (Previously it was possible to include HashSet and String but
not the correct HashTraits, so you would get an inefficient template
instantiation.)

Patch by Iain Merrick <hu...@google.com> on 2011-09-14
Reviewed by Darin Adler.

* wtf/HashTraits.h:
* wtf/text/StringHash.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (95089 => 95090)


--- trunk/Source/_javascript_Core/ChangeLog	2011-09-14 14:14:37 UTC (rev 95089)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-09-14 14:20:45 UTC (rev 95090)
@@ -1,3 +1,18 @@
+2011-09-14  Iain Merrick  <hu...@google.com>
+
+        HashTraits.h should include template specialization for WTF::String
+        https://bugs.webkit.org/show_bug.cgi?id=67851
+
+        Ensure that the template specialization for HashTraits<String> is always
+        picked up. (Previously it was possible to include HashSet and String but
+        not the correct HashTraits, so you would get an inefficient template
+        instantiation.)
+
+        Reviewed by Darin Adler.
+
+        * wtf/HashTraits.h:
+        * wtf/text/StringHash.h:
+
 2011-09-13  Filip Pizlo  <fpi...@apple.com>
 
         SpeculativeJIT::shouldSpeculateInteger(NodeIndex, NodeIndex) should

Modified: trunk/Source/_javascript_Core/wtf/HashTraits.h (95089 => 95090)


--- trunk/Source/_javascript_Core/wtf/HashTraits.h	2011-09-14 14:14:37 UTC (rev 95089)
+++ trunk/Source/_javascript_Core/wtf/HashTraits.h	2011-09-14 14:20:45 UTC (rev 95090)
@@ -28,6 +28,8 @@
 
 namespace WTF {
 
+    class String;
+
     using std::pair;
     using std::make_pair;
 
@@ -89,6 +91,7 @@
     };
 
     template<typename P> struct HashTraits<RefPtr<P> > : SimpleClassHashTraits<RefPtr<P> > { };
+    template<> struct HashTraits<String> : SimpleClassHashTraits<String> { };
 
     // special traits for pairs, helpful for their use in HashMap implementation
 

Modified: trunk/Source/_javascript_Core/wtf/text/StringHash.h (95089 => 95090)


--- trunk/Source/_javascript_Core/wtf/text/StringHash.h	2011-09-14 14:14:37 UTC (rev 95089)
+++ trunk/Source/_javascript_Core/wtf/text/StringHash.h	2011-09-14 14:20:45 UTC (rev 95090)
@@ -179,8 +179,6 @@
         }
     };
 
-    template<> struct HashTraits<String> : SimpleClassHashTraits<String> { };
-
 }
 
 using WTF::StringHash;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to