Commit b8e842cf authored by Lee Howes's avatar Lee Howes Committed by Facebook Github Bot

Missed l-value calls to future::then in Benchmark.cpp

Summary:
Overall plan to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue. The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

Add a std::move that was missed in the folly benchmark.

Reviewed By: shixiao

Differential Revision: D9197265

fbshipit-source-id: d02ab7b0dc22f6465910a80b2d0af1b54fb7bde7
parent 980baaf5
......@@ -36,7 +36,7 @@ T incr(Try<T>&& t) {
void someThens(size_t n) {
auto f = makeFuture<int>(42);
for (size_t i = 0; i < n; i++) {
f = f.then(incr<int>);
f = std::move(f).then(incr<int>);
}
}
......@@ -101,7 +101,7 @@ BENCHMARK(no_contention) {
consumer = std::thread([&]{
b1.post();
for (auto& f : futures) {
f.then(incr<int>);
std::move(f).then(incr<int>);
}
});
consumer.join();
......@@ -138,7 +138,7 @@ BENCHMARK_RELATIVE(contention) {
b1.post();
for (auto& f : futures) {
sem_wait(&sem);
f.then(incr<int>);
std::move(f).then(incr<int>);
}
});
......
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