Commit 2cb9738a authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Fix pessimizing moves (#1131)

Summary:
- GCC 9.1 warns when moving a local object in a return statement
  prevents copy elision.
- Remove the explicit `std::move` in those return statements.
Pull Request resolved: https://github.com/facebook/folly/pull/1131

Reviewed By: LeeHowes

Differential Revision: D15391413

Pulled By: yfeldblum

fbshipit-source-id: af29ea0f6f65957645fa2debce2f5303906a2507
parent 663d9c42
......@@ -2419,7 +2419,7 @@ inline basic_fbstring<E, T, A, S> operator+(
basic_fbstring<E, T, A, S> result;
result.reserve(lhs.size() + rhs.size());
result.append(lhs).append(rhs);
return std::move(result);
return result;
}
// C++11 21.4.8.1/2
......
......@@ -517,7 +517,7 @@ class Adaptor {
std::pair<Container, size_t> move() {
std::pair<Container, size_t> p(std::move(c_), lastCount_);
lastCount_ = Node::kElementCount;
return std::move(p);
return p;
}
/**
......
......@@ -125,7 +125,7 @@ addTasks(InputIterator first, InputIterator last) {
iterator.context_->results.reserve(iterator.context_->totalTasks);
return std::move(iterator);
return iterator;
}
} // namespace fibers
} // namespace folly
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment