Index: Source/wtf/HashTraits.h |
diff --git a/Source/wtf/HashTraits.h b/Source/wtf/HashTraits.h |
index 5a4371459a5adfcf83213f5353d203aa7eacfc61..af1fb02bba3a8e9cc9a6a1e5b0dd09b79e8c3197 100644 |
--- a/Source/wtf/HashTraits.h |
+++ b/Source/wtf/HashTraits.h |
@@ -86,7 +86,6 @@ namespace WTF { |
typedef const T* IteratorConstGetType; |
typedef T& IteratorReferenceType; |
typedef const T& IteratorConstReferenceType; |
- static IteratorConstGetType getToConstGetConversion(const T* x) { return x; } |
tkent
2014/03/03 10:19:57
Why do you remove this line?
Mads Ager (chromium)
2014/03/03 10:20:50
Because it is unused in the code base. :)
tkent
2014/03/03 10:23:43
I see. I don't think we should include this chang
Mads Ager (chromium)
2014/03/03 10:30:35
It seems to me that removing dead code is always a
|
static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { return *x; } |
static IteratorConstReferenceType getToReferenceConstConversion(IteratorConstGetType x) { return *x; } |
// Type for functions that take ownership, such as add. |
@@ -191,6 +190,26 @@ namespace WTF { |
static PeekOutType peek(std::nullptr_t) { return 0; } |
}; |
+ template<typename T> struct HashTraits<RawPtr<T> > : SimpleClassHashTraits<RawPtr<T> > { |
+ static const bool needsDestruction = false; |
+ typedef T* PeekInType; |
+ typedef T* PassInType; |
+ typedef RawPtr<T>* IteratorGetType; |
+ typedef const RawPtr<T>* IteratorConstGetType; |
+ typedef RawPtr<T>& IteratorReferenceType; |
+ typedef T* const IteratorConstReferenceType; |
Mikhail
2014/03/03 10:25:56
could I ask why 'IteratorReferenceType' and 'Itera
Mads Ager (chromium)
2014/03/03 10:29:00
Yes, there is no reason for the extra indirection
|
+ static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { return *x; } |
+ static IteratorConstReferenceType getToReferenceConstConversion(IteratorConstGetType x) { return x->get(); } |
+ typedef T* PeekOutType; |
+ typedef T* PassOutType; |
+ |
+ template<typename U> |
+ static void store(const U& value, RawPtr<T>& storage) { storage = value; } |
+ |
+ static PeekOutType peek(const RawPtr<T>& value) { return value; } |
+ static PassOutType passOut(const RawPtr<T>& value) { return value; } |
+ }; |
+ |
template<> struct HashTraits<String> : SimpleClassHashTraits<String> { |
static const bool hasIsEmptyValueFunction = true; |
static bool isEmptyValue(const String&); |