Chromium Code Reviews| Index: mojo/public/cpp/bindings/array.h |
| diff --git a/mojo/public/cpp/bindings/array.h b/mojo/public/cpp/bindings/array.h |
| index f7d392178b3f0dfa9bb56336ea81307d2565d270..435f6b81c0deed190ce77c000425b450d5e4f3ed 100644 |
| --- a/mojo/public/cpp/bindings/array.h |
| +++ b/mojo/public/cpp/bindings/array.h |
| @@ -6,10 +6,10 @@ |
| #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
| #include <string.h> |
| - |
| #include <algorithm> |
| #include <set> |
| #include <string> |
| +#include <utility> |
| #include <vector> |
| #include "mojo/public/cpp/bindings/lib/array_internal.h" |
| @@ -56,7 +56,7 @@ class Array { |
| // Creates a non-null array of the specified size. The elements will be |
| // value-initialized (meaning that they will be initialized by their default |
| // constructor, if any, or else zero-initialized). |
| - static Array New(size_t size) { return Array(size).Pass(); } |
| + static Array New(size_t size) { return std::move(Array(size)); } |
|
Ken Rockot(use gerrit already)
2015/12/21 18:49:22
Shouldn't clang complain that moving a temporary p
dcheng
2015/12/21 19:27:27
It does in many instances: you'll notice that some
|
| // Creates a new array with a copy of the contents of |other|. |
| template <typename U> |
| @@ -145,7 +145,7 @@ class Array { |
| Array result; |
| result.is_null_ = is_null_; |
| Traits::Clone(vec_, &result.vec_); |
| - return result.Pass(); |
| + return std::move(result); |
| } |
| // Indicates whether the contents of this array are equal to |other|. A null |
| @@ -196,7 +196,7 @@ struct TypeConverter<Array<T>, std::vector<E>> { |
| Array<T> result(input.size()); |
| for (size_t i = 0; i < input.size(); ++i) |
| result[i] = TypeConverter<T, E>::Convert(input[i]); |
| - return result.Pass(); |
| + return std::move(result); |
| } |
| }; |
| @@ -225,7 +225,7 @@ struct TypeConverter<Array<T>, std::set<E>> { |
| Array<T> result(0u); |
| for (auto i : input) |
| result.push_back(TypeConverter<T, E>::Convert(i)); |
| - return result.Pass(); |
| + return std::move(result); |
| } |
| }; |