summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/wtf/HashCountedSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/wtf/HashCountedSet.h')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/HashCountedSet.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/HashCountedSet.h b/src/3rdparty/webkit/JavaScriptCore/wtf/HashCountedSet.h
index 1a422d8..1fda9c1 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/HashCountedSet.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/HashCountedSet.h
@@ -64,8 +64,13 @@ namespace WTF {
void remove(const ValueType& value);
void remove(iterator it);
- void clear();
-
+ // removes the value, regardless of its count
+ void clear(iterator it);
+ void clear(const ValueType& value);
+
+ // clears the whole set
+ void clear();
+
private:
ImplType m_impl;
};
@@ -166,6 +171,21 @@ namespace WTF {
}
template<typename Value, typename HashFunctions, typename Traits>
+ inline void HashCountedSet<Value, HashFunctions, Traits>::clear(const ValueType& value)
+ {
+ clear(find(value));
+ }
+
+ template<typename Value, typename HashFunctions, typename Traits>
+ inline void HashCountedSet<Value, HashFunctions, Traits>::clear(iterator it)
+ {
+ if (it == end())
+ return;
+
+ m_impl.remove(it);
+ }
+
+ template<typename Value, typename HashFunctions, typename Traits>
inline void HashCountedSet<Value, HashFunctions, Traits>::clear()
{
m_impl.clear();