Commit edd050b1 authored by Marshall Cline's avatar Marshall Cline Committed by Facebook Github Bot

modernize Future::get(): 4/n = codemod to std::move for non-ptr exprs

Summary:
Codemod non-pointer expressions:
   - expr.get() ==> std::move(expr).get()
   - expr.get(dur) ==> std::move(expr).get(dur)
when expr is not already an xvalue.

Reviewed By: yfeldblum

Differential Revision: D8430137

fbshipit-source-id: 20da463f9cceb5cb1e71a7226f3b11d1e8007011
parent de0344eb
......@@ -1494,8 +1494,8 @@ TEST(FiberManager, remoteFutureTest) {
auto f1 = fiberManager.addTaskFuture([&]() { return testValue1; });
auto f2 = fiberManager.addTaskRemoteFuture([&]() { return testValue2; });
loopController.loop([&]() { loopController.stop(); });
auto v1 = f1.get();
auto v2 = f2.get();
auto v1 = std::move(f1).get();
auto v2 = std::move(f2).get();
EXPECT_EQ(v1, testValue1);
EXPECT_EQ(v2, testValue2);
......
......@@ -319,7 +319,7 @@ BENCHMARK(lvalue_get) {
Optional<Future<Bulky>> future;
future = makeFuture(Bulky("Hello"));
suspender.dismissing([&] {
std::string message = future.value().get().message();
std::string message = std::move(future.value()).get().message();
doNotOptimizeAway(message);
});
}
......
......@@ -256,7 +256,7 @@ TEST(AsyncFileWriter, flush) {
readFull(readPipe.fd(), buf.data(), buf.size());
// Make sure flush completes successfully now
future.get(10ms);
std::move(future).get(10ms);
}
// A large-ish message suffix, just to consume space and help fill up
......
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