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

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

Issue 2250353002: Introduce copyToVector for HeapHashCountedSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-some-hash-counted-set-copy-to-vector
Patch Set: Created 4 years, 4 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/platform/heap/HeapTest.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/HashCountedSet.h
diff --git a/third_party/WebKit/Source/wtf/HashCountedSet.h b/third_party/WebKit/Source/wtf/HashCountedSet.h
index c6b39e1862dc170284ea258094454a0f37a9140c..b96b8c2d4fb7f949bd0c71333080dfbd708bc99e 100644
--- a/third_party/WebKit/Source/wtf/HashCountedSet.h
+++ b/third_party/WebKit/Source/wtf/HashCountedSet.h
@@ -135,19 +135,17 @@ inline void HashCountedSet<T, U, V, W>::removeAll(iterator it)
m_impl.remove(it);
}
-template <typename Value, typename HashFunctions, typename Traits, typename Allocator, size_t inlineCapacity, typename VectorAllocator>
-inline void copyToVector(const HashCountedSet<Value, HashFunctions, Traits, Allocator>& collection, Vector<Value, inlineCapacity, VectorAllocator>& vector)
+template <typename Value, typename HashFunctions, typename Traits, typename Allocator, typename VectorType>
+inline void copyToVector(const HashCountedSet<Value, HashFunctions, Traits, Allocator>& collection, VectorType& vector)
{
- typedef typename HashCountedSet<Value, HashFunctions, Traits, Allocator>::const_iterator iterator;
-
{
// Disallow GC across resize allocation, see crbug.com/568173
- typename Vector<Value, inlineCapacity, VectorAllocator>::GCForbiddenScope scope;
+ typename VectorType::GCForbiddenScope scope;
vector.resize(collection.size());
}
- iterator it = collection.begin();
- iterator end = collection.end();
+ auto it = collection.begin();
+ auto end = collection.end();
for (unsigned i = 0; it != end; ++it, ++i)
vector[i] = (*it).key;
}
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698