summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/wtf/HashSet.h
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-10-08 17:19:54 +0100
committerSteve Block <steveblock@google.com>2009-10-20 00:41:58 +0100
commit231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch)
treea6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /JavaScriptCore/wtf/HashSet.h
parente196732677050bd463301566a68a643b6d14b907 (diff)
downloadexternal_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip
external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz
external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'JavaScriptCore/wtf/HashSet.h')
-rw-r--r--JavaScriptCore/wtf/HashSet.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/JavaScriptCore/wtf/HashSet.h b/JavaScriptCore/wtf/HashSet.h
index 990670d..f4e2cf7 100644
--- a/JavaScriptCore/wtf/HashSet.h
+++ b/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;
};
@@ -251,6 +254,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)