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

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

Issue 2693433002: Migrate WTF::HashMap::add() to ::insert() [final] (Closed)
Patch Set: more platform-specific references 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
Index: third_party/WebKit/Source/wtf/HashMap.h
diff --git a/third_party/WebKit/Source/wtf/HashMap.h b/third_party/WebKit/Source/wtf/HashMap.h
index eb58eeafd520045a7593df44935fbadad0d8c4e1..de8a0fbd03ce0a9f8f6f1e63189c84cd2956b05b 100644
--- a/third_party/WebKit/Source/wtf/HashMap.h
+++ b/third_party/WebKit/Source/wtf/HashMap.h
@@ -147,10 +147,6 @@ class HashMap {
// does nothing if key is already present return value is a pair of the
// iterator to the key location, and a boolean that's true if a new value
// was actually added
- // TODO(pilgrim) remove deprecated add() method, use insert() instead
- // https://crbug.com/662431
- template <typename IncomingKeyType, typename IncomingMappedType>
- AddResult add(IncomingKeyType&&, IncomingMappedType&&);
template <typename IncomingKeyType, typename IncomingMappedType>
AddResult insert(IncomingKeyType&&, IncomingMappedType&&);
@@ -180,19 +176,13 @@ class HashMap {
template <typename HashTranslator, typename T>
bool contains(const T&) const;
- // An alternate version of add() that finds the object by hashing and
+ // An alternate version of insert() that finds the object by hashing and
// comparing with some other type, to avoid the cost of type conversion if
// the object is already in the table. HashTranslator must have the
// following function members:
// static unsigned hash(const T&);
// static bool equal(const ValueType&, const T&);
// static translate(ValueType&, const T&, unsigned hashCode);
- // TODO(pilgrim) remove deprecated add() method, use insert() instead
- // https://crbug.com/662431
- template <typename HashTranslator,
- typename IncomingKeyType,
- typename IncomingMappedType>
- AddResult add(IncomingKeyType&&, IncomingMappedType&&);
template <typename HashTranslator,
typename IncomingKeyType,
typename IncomingMappedType>
@@ -575,23 +565,6 @@ template <typename T,
template <typename HashTranslator,
typename IncomingKeyType,
typename IncomingMappedType>
-auto HashMap<T, U, V, W, X, Y>::add(IncomingKeyType&& key,
- IncomingMappedType&& mapped) -> AddResult {
- return m_impl.template addPassingHashCode<
- HashMapTranslatorAdapter<ValueTraits, HashTranslator>>(
- std::forward<IncomingKeyType>(key),
- std::forward<IncomingMappedType>(mapped));
-}
-
-template <typename T,
- typename U,
- typename V,
- typename W,
- typename X,
- typename Y>
-template <typename HashTranslator,
- typename IncomingKeyType,
- typename IncomingMappedType>
auto HashMap<T, U, V, W, X, Y>::insert(IncomingKeyType&& key,
IncomingMappedType&& mapped)
-> AddResult {
@@ -608,20 +581,6 @@ template <typename T,
typename X,
typename Y>
template <typename IncomingKeyType, typename IncomingMappedType>
-typename HashMap<T, U, V, W, X, Y>::AddResult HashMap<T, U, V, W, X, Y>::add(
- IncomingKeyType&& key,
- IncomingMappedType&& mapped) {
- return inlineAdd(std::forward<IncomingKeyType>(key),
- std::forward<IncomingMappedType>(mapped));
-}
-
-template <typename T,
- typename U,
- typename V,
- typename W,
- typename X,
- typename Y>
-template <typename IncomingKeyType, typename IncomingMappedType>
typename HashMap<T, U, V, W, X, Y>::AddResult HashMap<T, U, V, W, X, Y>::insert(
IncomingKeyType&& key,
IncomingMappedType&& mapped) {

Powered by Google App Engine
This is Rietveld 408576698