Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: third_party/WebKit/Source/wtf/ListHashSet.h

Issue 2724363002: Migrate WTF::LinkedHashSet/ListHashSet::add() to ::insert() (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/LinkedHashSet.h ('k') | third_party/WebKit/Source/wtf/ListHashSetTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/ListHashSet.h
diff --git a/third_party/WebKit/Source/wtf/ListHashSet.h b/third_party/WebKit/Source/wtf/ListHashSet.h
index 872934492219a62fdfc0fb8844d366ac2a25be95..ad1ed1ebaa5b2536257faeb43ff91813e4edede8 100644
--- a/third_party/WebKit/Source/wtf/ListHashSet.h
+++ b/third_party/WebKit/Source/wtf/ListHashSet.h
@@ -185,14 +185,12 @@ class ListHashSet
template <typename HashTranslator, typename T>
bool contains(const T&) const;
- // The return value of add is a pair of a pointer to the stored value, and a
- // bool that is true if an new entry was added.
- template <typename IncomingValueType>
- AddResult add(IncomingValueType&&);
+ // The return value of insert is a pair of a pointer to the stored value, and
+ // a bool that is true if an new entry was added.
template <typename IncomingValueType>
AddResult insert(IncomingValueType&&);
- // Same as add() except that the return value is an iterator. Useful in
+ // Same as insert() except that the return value is an iterator. Useful in
// cases where it's needed to have the same return value as find() and where
// it's not possible to use a pointer to the storedValue.
template <typename IncomingValueType>
@@ -770,7 +768,7 @@ inline ListHashSet<T, inlineCapacity, U, V>::ListHashSet(
: m_head(nullptr), m_tail(nullptr) {
const_iterator end = other.end();
for (const_iterator it = other.begin(); it != end; ++it)
- add(*it);
+ insert(*it);
}
template <typename T, size_t inlineCapacity, typename U, typename V>
@@ -918,7 +916,7 @@ inline bool ListHashSet<T, inlineCapacity, U, V>::contains(
template <typename T, size_t inlineCapacity, typename U, typename V>
template <typename IncomingValueType>
typename ListHashSet<T, inlineCapacity, U, V>::AddResult
-ListHashSet<T, inlineCapacity, U, V>::add(IncomingValueType&& value) {
+ListHashSet<T, inlineCapacity, U, V>::insert(IncomingValueType&& value) {
createAllocatorIfNeeded();
// The second argument is a const ref. This is useful for the HashTable
// because it lets it take lvalues by reference, but for our purposes it's
@@ -933,17 +931,10 @@ ListHashSet<T, inlineCapacity, U, V>::add(IncomingValueType&& value) {
template <typename T, size_t inlineCapacity, typename U, typename V>
template <typename IncomingValueType>
-typename ListHashSet<T, inlineCapacity, U, V>::AddResult
-ListHashSet<T, inlineCapacity, U, V>::insert(IncomingValueType&& value) {
- return add(value);
-}
-
-template <typename T, size_t inlineCapacity, typename U, typename V>
-template <typename IncomingValueType>
typename ListHashSet<T, inlineCapacity, U, V>::iterator
ListHashSet<T, inlineCapacity, U, V>::addReturnIterator(
IncomingValueType&& value) {
- return makeIterator(add(std::forward<IncomingValueType>(value)).m_node);
+ return makeIterator(insert(std::forward<IncomingValueType>(value)).m_node);
}
template <typename T, size_t inlineCapacity, typename U, typename V>
« no previous file with comments | « third_party/WebKit/Source/wtf/LinkedHashSet.h ('k') | third_party/WebKit/Source/wtf/ListHashSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698