Commit 248c5598 authored by Anton Bikineev's avatar Anton Bikineev Committed by Commit Bot

WTF: Remove useless Allocator param from LinkedHashSetNode

Change-Id: I1729710a62f1cc288ec947c7532ed61721fcd720
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862681Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705928}
parent 17ccae2c
......@@ -580,19 +580,18 @@ struct TraceInCollectionTrait<kWeakHandling, KeyValuePair<Key, Value>, Traits> {
// Nodes used by LinkedHashSet. Again we need two versions to disambiguate the
// template.
template <typename Value, typename Allocator, typename Traits>
template <typename Value, typename Traits>
struct TraceInCollectionTrait<kNoWeakHandling,
LinkedHashSetNode<Value, Allocator>,
LinkedHashSetNode<Value>,
Traits> {
static bool IsAlive(LinkedHashSetNode<Value, Allocator>& self) {
static bool IsAlive(LinkedHashSetNode<Value>& self) {
return TraceInCollectionTrait<
kNoWeakHandling, Value,
typename Traits::ValueTraits>::IsAlive(self.value_);
}
template <typename VisitorDispatcher>
static bool Trace(VisitorDispatcher visitor,
LinkedHashSetNode<Value, Allocator>& self) {
static bool Trace(VisitorDispatcher visitor, LinkedHashSetNode<Value>& self) {
static_assert(IsTraceableInCollectionTrait<Traits>::value ||
Traits::kWeakHandlingFlag == WTF::kWeakHandling,
"T should not be traced");
......@@ -602,19 +601,16 @@ struct TraceInCollectionTrait<kNoWeakHandling,
}
};
template <typename Value, typename Allocator, typename Traits>
struct TraceInCollectionTrait<kWeakHandling,
LinkedHashSetNode<Value, Allocator>,
Traits> {
static bool IsAlive(LinkedHashSetNode<Value, Allocator>& self) {
template <typename Value, typename Traits>
struct TraceInCollectionTrait<kWeakHandling, LinkedHashSetNode<Value>, Traits> {
static bool IsAlive(LinkedHashSetNode<Value>& self) {
return TraceInCollectionTrait<
kWeakHandling, Value,
typename Traits::ValueTraits>::IsAlive(self.value_);
}
template <typename VisitorDispatcher>
static bool Trace(VisitorDispatcher visitor,
LinkedHashSetNode<Value, Allocator>& self) {
static bool Trace(VisitorDispatcher visitor, LinkedHashSetNode<Value>& self) {
return TraceInCollectionTrait<
kWeakHandling, Value, typename Traits::ValueTraits>::Trace(visitor,
self.value_);
......
......@@ -136,7 +136,7 @@ class LinkedHashSetNodeBase {
LinkedHashSetNodeBase& operator=(const LinkedHashSetNodeBase& other) = delete;
};
template <typename ValueArg, typename Allocator>
template <typename ValueArg>
class LinkedHashSetNode : public LinkedHashSetNodeBase {
DISALLOW_NEW();
......@@ -171,7 +171,7 @@ class LinkedHashSet {
private:
typedef ValueArg Value;
typedef TraitsArg Traits;
typedef LinkedHashSetNode<Value, Allocator> Node;
typedef LinkedHashSetNode<Value> Node;
typedef LinkedHashSetNodeBase NodeBase;
typedef LinkedHashSetTranslator<Value, HashFunctions, Allocator>
NodeHashFunctions;
......@@ -361,7 +361,7 @@ class LinkedHashSet {
template <typename Value, typename HashFunctions, typename Allocator>
struct LinkedHashSetTranslator {
STATIC_ONLY(LinkedHashSetTranslator);
typedef LinkedHashSetNode<Value, Allocator> Node;
typedef LinkedHashSetNode<Value> Node;
typedef LinkedHashSetNodeBase NodeBase;
typedef typename HashTraits<Value>::PeekInType ValuePeekInType;
static unsigned GetHash(const Node& node) {
......@@ -394,16 +394,16 @@ struct LinkedHashSetTranslator {
template <typename Value, typename Allocator>
struct LinkedHashSetExtractor {
STATIC_ONLY(LinkedHashSetExtractor);
static const Value& Extract(const LinkedHashSetNode<Value, Allocator>& node) {
static const Value& Extract(const LinkedHashSetNode<Value>& node) {
return node.value_;
}
};
template <typename Value, typename ValueTraitsArg, typename Allocator>
struct LinkedHashSetTraits
: public SimpleClassHashTraits<LinkedHashSetNode<Value, Allocator>> {
: public SimpleClassHashTraits<LinkedHashSetNode<Value>> {
STATIC_ONLY(LinkedHashSetTraits);
using Node = LinkedHashSetNode<Value, Allocator>;
using Node = LinkedHashSetNode<Value>;
using NodeBase = LinkedHashSetNodeBase;
typedef ValueTraitsArg ValueTraits;
......@@ -961,8 +961,7 @@ inline void LinkedHashSet<T, U, V, W>::erase(ValuePeekInType value) {
}
template <typename T, typename Allocator>
inline void swap(LinkedHashSetNode<T, Allocator>& a,
LinkedHashSetNode<T, Allocator>& b) {
inline void swap(LinkedHashSetNode<T>& a, LinkedHashSetNode<T>& b) {
typedef LinkedHashSetNodeBase Base;
// The key and value cannot be swapped atomically, and it would be
// wrong to have a GC when only one was swapped and the other still
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment