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

Unified Diff: mojo/public/cpp/bindings/lib/array_internal.h

Issue 1535943002: Convert Pass()→std::move() in //mojo/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove self-move checks to avoid triggering clang warning. Created 5 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
Index: mojo/public/cpp/bindings/lib/array_internal.h
diff --git a/mojo/public/cpp/bindings/lib/array_internal.h b/mojo/public/cpp/bindings/lib/array_internal.h
index 41ca174d1d27c353f00f6727197b8c7991141890..bab7250416030f7c6dd9f196958ca8b6a9284289 100644
--- a/mojo/public/cpp/bindings/lib/array_internal.h
+++ b/mojo/public/cpp/bindings/lib/array_internal.h
@@ -6,6 +6,7 @@
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_INTERNAL_H_
#include <new>
+#include <utility>
#include <vector>
#include "mojo/public/c/system/macros.h"
@@ -502,7 +503,7 @@ struct ArrayTraits<T, true> {
static inline void PushBack(std::vector<StorageType>* vec, RefType value) {
size_t old_size = vec->size();
ResizeStorage(vec, old_size + 1);
- new (vec->at(old_size).buf) T(value.Pass());
+ new (vec->at(old_size).buf) T(std::move(value));
}
static inline void ResizeStorage(std::vector<StorageType>* vec, size_t size) {
if (size <= vec->capacity()) {
@@ -511,7 +512,7 @@ struct ArrayTraits<T, true> {
}
std::vector<StorageType> new_storage(size);
for (size_t i = 0; i < vec->size(); i++)
- new (new_storage.at(i).buf) T(at(vec, i).Pass());
+ new (new_storage.at(i).buf) T(std::move(at(vec, i)));
vec->swap(new_storage);
Finalize(&new_storage);
}

Powered by Google App Engine
This is Rietveld 408576698