diff options
author | danakj <danakj@chromium.org> | 2015-11-20 12:14:21 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-20 20:15:52 +0000 |
commit | a5a05ba0c699fa31ecb98cfe0dee84513a98b2a8 (patch) | |
tree | 393724e1f22b1ea1094e298650e7e8fe1afdb2f6 /cc/base | |
parent | d90cc42f3499cb3c98d73a31db6586fd3e1e686b (diff) | |
download | chromium_src-a5a05ba0c699fa31ecb98cfe0dee84513a98b2a8.zip chromium_src-a5a05ba0c699fa31ecb98cfe0dee84513a98b2a8.tar.gz chromium_src-a5a05ba0c699fa31ecb98cfe0dee84513a98b2a8.tar.bz2 |
cc: Remove calls to Pass() on rvalues.
These are not useful and break RVO. std::move() will (soon) warn us for
doing this on scoped_ptrs.
Also use move() instead of Pass() in container_util.h
This gets rid of the remaining calls to Pass() in all of src/cc/.
R=enne, vmpstr
BUG=557422
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1461803003
Cr-Commit-Position: refs/heads/master@{#360898}
Diffstat (limited to 'cc/base')
-rw-r--r-- | cc/base/container_util.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cc/base/container_util.h b/cc/base/container_util.h index 2f0da6c..65a9d31 100644 --- a/cc/base/container_util.h +++ b/cc/base/container_util.h @@ -9,22 +9,18 @@ namespace cc { -// Removes the front element from the container and returns it. Note that this -// currently only works with types that implement Pass(). -// TODO(vmpstr): Use std::move instead of Pass when allowed. +// Removes the front element from the container and returns it. template <typename Container> typename Container::value_type PopFront(Container* container) { - typename Container::value_type element = container->front().Pass(); + typename Container::value_type element = std::move(container->front()); container->pop_front(); return element; } -// Removes the back element from the container and returns it. Note that this -// currently only works with types that implement Pass(). -// TODO(vmpstr): Use std::move instead of Pass when allowed. +// Removes the back element from the container and returns it. template <typename Container> typename Container::value_type PopBack(Container* container) { - typename Container::value_type element = container->back().Pass(); + typename Container::value_type element = std::move(container->back()); container->pop_back(); return element; } |