Changeset 34891 in webkit for trunk/JavaScriptCore/wtf/HashTraits.h
- Timestamp:
- Jun 30, 2008, 8:58:27 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/HashTraits.h
r32650 r34891 87 87 static const bool emptyValueIsZero = true; 88 88 static const bool needsDestruction = false; 89 static void constructDeletedValue(T * slot) { *slot = static_cast<T>(-1); }89 static void constructDeletedValue(T& slot) { slot = static_cast<T>(-1); } 90 90 static bool isDeletedValue(T value) { return value == static_cast<T>(-1); } 91 91 }; … … 101 101 static const bool needsDestruction = false; 102 102 static T emptyValue() { return std::numeric_limits<T>::infinity(); } 103 static void constructDeletedValue(T * slot) { *slot = -std::numeric_limits<T>::infinity(); }103 static void constructDeletedValue(T& slot) { slot = -std::numeric_limits<T>::infinity(); } 104 104 static bool isDeletedValue(T value) { return value == -std::numeric_limits<T>::infinity(); } 105 105 }; … … 111 111 static const bool emptyValueIsZero = true; 112 112 static const bool needsDestruction = false; 113 static void constructDeletedValue(P* * slot) { *slot = reinterpret_cast<P*>(-1); }113 static void constructDeletedValue(P*& slot) { slot = reinterpret_cast<P*>(-1); } 114 114 static bool isDeletedValue(P* value) { return value == reinterpret_cast<P*>(-1); } 115 115 }; … … 117 117 template<typename P> struct HashTraits<RefPtr<P> > : GenericHashTraits<RefPtr<P> > { 118 118 static const bool emptyValueIsZero = true; 119 static void constructDeletedValue(RefPtr<P> * slot) { new (slot) RefPtr<P>(HashTableDeletedValue); }119 static void constructDeletedValue(RefPtr<P>& slot) { new (&slot) RefPtr<P>(HashTableDeletedValue); } 120 120 static bool isDeletedValue(const RefPtr<P>& value) { return value.isHashTableDeletedValue(); } 121 121 }; … … 134 134 static const bool needsDestruction = FirstTraits::needsDestruction || SecondTraits::needsDestruction; 135 135 136 static void constructDeletedValue(TraitType * slot) { FirstTraits::constructDeletedValue(&slot->first); }136 static void constructDeletedValue(TraitType& slot) { FirstTraits::constructDeletedValue(slot.first); } 137 137 static bool isDeletedValue(const TraitType& value) { return FirstTraits::isDeletedValue(value.first); } 138 138 };
Note:
See TracChangeset
for help on using the changeset viewer.