Simplify RetainPtrObjectHashTraits
authormikhail.pozdnyakov@intel.com <mikhail.pozdnyakov@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2013 22:08:33 +0000 (22:08 +0000)
committermikhail.pozdnyakov@intel.com <mikhail.pozdnyakov@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2013 22:08:33 +0000 (22:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=115822

Reviewed by Benjamin Poulain.

RetainPtrObjectHashTraits is inherited from SimpleClassHashTraits
instead of GenericHashTraits re-using more shared functionality.

* wtf/RetainPtr.h:
(WTF::RetainPtrObjectHashTraits::emptyValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149770 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/RetainPtr.h

index 30bd00f..e6debed 100644 (file)
@@ -1,3 +1,16 @@
+2013-05-08  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
+
+        Simplify RetainPtrObjectHashTraits
+        https://bugs.webkit.org/show_bug.cgi?id=115822
+
+        Reviewed by Benjamin Poulain.
+
+        RetainPtrObjectHashTraits is inherited from SimpleClassHashTraits
+        instead of GenericHashTraits re-using more shared functionality.
+
+        * wtf/RetainPtr.h:
+        (WTF::RetainPtrObjectHashTraits::emptyValue):
+
 2013-05-08  Anders Carlsson  <andersca@apple.com>
 
         Assert at compile time that we don't pass Objective-C object pointers to adoptCF
index 9ad1dbc..91e76f5 100644 (file)
@@ -301,16 +301,12 @@ namespace WTF {
     template<typename P> struct DefaultHash<RetainPtr<P> > { typedef PtrHash<RetainPtr<P> > Hash; };
 
     template <typename P>
-    struct RetainPtrObjectHashTraits : GenericHashTraits<RetainPtr<P> > {
-        static const bool emptyValueIsZero = true;
+    struct RetainPtrObjectHashTraits : SimpleClassHashTraits<RetainPtr<P> > {
         static const RetainPtr<P>& emptyValue()
         {
             static RetainPtr<P>& null = *(new RetainPtr<P>);
             return null;
         }
-        static const bool needsDestruction = true;
-        static void constructDeletedValue(RetainPtr<P>& slot) { new (&slot) RetainPtr<P>(HashTableDeletedValue); }
-        static bool isDeletedValue(const RetainPtr<P>& value) { return value.isHashTableDeletedValue(); }
     };
 
     template <typename P>