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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 11 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/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/HashSet.h
diff --git a/third_party/WebKit/Source/wtf/HashSet.h b/third_party/WebKit/Source/wtf/HashSet.h
index 310116a4b647f2b465c5e1ba15a9761d679a9bf3..68a02dd72d64fb6e9b81c794e2a807a6c0337925 100644
--- a/third_party/WebKit/Source/wtf/HashSet.h
+++ b/third_party/WebKit/Source/wtf/HashSet.h
@@ -106,6 +106,8 @@ class HashSet {
// The return value is a pair of an iterator to the new value's location,
// and a bool that is true if an new entry was added.
template <typename IncomingValueType>
+ AddResult insert(IncomingValueType&&);
+ template <typename IncomingValueType>
AddResult add(IncomingValueType&&);
// An alternate version of add() that finds the object by hashing and
@@ -173,7 +175,7 @@ HashSet<Value, HashFunctions, Traits, Allocator>::HashSet(
if (elements.size())
m_impl.reserveCapacityForSize(elements.size());
for (const ValueType& element : elements)
- add(element);
+ insert(element);
}
template <typename Value,
@@ -251,6 +253,15 @@ inline bool HashSet<Value, HashFunctions, Traits, Allocator>::contains(
template <typename T, typename U, typename V, typename W>
template <typename IncomingValueType>
+inline typename HashSet<T, U, V, W>::AddResult HashSet<T, U, V, W>::insert(
+ IncomingValueType&& value) {
+ return m_impl.add(std::forward<IncomingValueType>(value));
+}
+
+// TODO(pilgrim) remove this method once all references and subclasses
+// have been migrated to insert() method
+template <typename T, typename U, typename V, typename W>
+template <typename IncomingValueType>
inline typename HashSet<T, U, V, W>::AddResult HashSet<T, U, V, W>::add(
IncomingValueType&& value) {
return m_impl.add(std::forward<IncomingValueType>(value));
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698