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

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

Issue 2554693003: Migrate WTF::Vector::append() to ::push_back() [part 1 of N] (Closed)
Patch Set: rebase Created 4 years 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/bindings/modules/v8/V8BindingForModules.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/Vector.h
diff --git a/third_party/WebKit/Source/wtf/Vector.h b/third_party/WebKit/Source/wtf/Vector.h
index e020aceae80e6644a1f7d9149a3e3cad493642c9..f069d933fca4d57674a09a6260c1682f0210eb9c 100644
--- a/third_party/WebKit/Source/wtf/Vector.h
+++ b/third_party/WebKit/Source/wtf/Vector.h
@@ -945,6 +945,8 @@ class Vector
void append(const U*, size_t);
template <typename U>
void append(U&&);
+ template <typename U>
+ void push_back(U&&);
template <typename... Args>
T& emplace_back(Args&&...);
template <typename U>
@@ -1382,6 +1384,12 @@ void Vector<T, inlineCapacity, Allocator>::append(const U* data,
template <typename T, size_t inlineCapacity, typename Allocator>
template <typename U>
+ALWAYS_INLINE void Vector<T, inlineCapacity, Allocator>::push_back(U&& val) {
+ return append(std::forward<U>(val));
+}
+
+template <typename T, size_t inlineCapacity, typename Allocator>
+template <typename U>
ALWAYS_INLINE void Vector<T, inlineCapacity, Allocator>::append(U&& val) {
ASSERT(Allocator::isAllocationAllowed());
if (LIKELY(size() != capacity())) {
« no previous file with comments | « third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698