diff options
Diffstat (limited to 'src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h index ec809e549c..3906a36b23 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h @@ -29,6 +29,8 @@ namespace WTF { template<typename Value, typename HashFunctions, typename Traits> class HashSet; template<typename Value, typename HashFunctions, typename Traits> void deleteAllValues(const HashSet<Value, HashFunctions, Traits>&); + template<typename Value, typename HashFunctions, typename Traits> + void fastDeleteAllValues(const HashSet<Value, HashFunctions, Traits>&); template<typename T> struct IdentityExtractor; @@ -91,6 +93,7 @@ namespace WTF { private: friend void deleteAllValues<>(const HashSet&); + friend void fastDeleteAllValues<>(const HashSet&); HashTableType m_impl; }; @@ -257,6 +260,21 @@ namespace WTF { { deleteAllValues<typename HashSet<T, U, V>::ValueType>(collection.m_impl); } + + template<typename ValueType, typename HashTableType> + void fastDeleteAllValues(HashTableType& collection) + { + typedef typename HashTableType::const_iterator iterator; + iterator end = collection.end(); + for (iterator it = collection.begin(); it != end; ++it) + fastDelete(*it); + } + + template<typename T, typename U, typename V> + inline void fastDeleteAllValues(const HashSet<T, U, V>& collection) + { + fastDeleteAllValues<typename HashSet<T, U, V>::ValueType>(collection.m_impl); + } template<typename T, typename U, typename V, typename W> inline void copyToVector(const HashSet<T, U, V>& collection, W& vector) |