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

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

Issue 1968043002: Get rid of 'PassInType' in hash traits and containers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/wtf/HashSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c9f6796499257d8e597de6ad19f54ba7f0667f75..776ccba0eea01f503b60cd67f3b8c90f2b415131 100644
--- a/third_party/WebKit/Source/wtf/HashMap.h
+++ b/third_party/WebKit/Source/wtf/HashMap.h
@@ -58,7 +58,6 @@ public:
typedef typename ValueTraits::TraitType ValueType;
private:
- typedef typename MappedTraits::PassInType MappedPassInType;
typedef typename MappedTraits::PeekOutType MappedPeekType;
typedef HashArg HashFunctions;
@@ -142,7 +141,8 @@ public:
// static unsigned hash(const T&);
// static bool equal(const ValueType&, const T&);
// static translate(ValueType&, const T&, unsigned hashCode);
- template <typename HashTranslator, typename T> AddResult add(const T&, MappedPassInType);
+ template <typename HashTranslator, typename IncomingKeyType, typename IncomingMappedType>
+ AddResult add(IncomingKeyType&&, IncomingMappedType&&);
static bool isValidKey(KeyPeekInType);
@@ -377,11 +377,11 @@ HashMap<T, U, V, W, X, Y>::set(IncomingKeyType&& key, IncomingMappedType&& mappe
}
template <typename T, typename U, typename V, typename W, typename X, typename Y>
-template <typename HashTranslator, typename TYPE>
-typename HashMap<T, U, V, W, X, Y>::AddResult
-HashMap<T, U, V, W, X, Y>::add(const TYPE& key, MappedPassInType value)
+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>>(key, value);
+ 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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/HashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698