Commit f2fa1176 authored by Matthieu Martin's avatar Matthieu Martin Committed by Facebook GitHub Bot

Folly coro: missing executor move

Summary: This should reduce refcounting

Reviewed By: lewissbaker

Differential Revision: D20911114

fbshipit-source-id: be941a5e0a095652c916e4704b0dd29874e0979d
parent ff22ce9a
...@@ -172,7 +172,7 @@ class ViaIfAsyncAwaiter { ...@@ -172,7 +172,7 @@ class ViaIfAsyncAwaiter {
explicit ViaIfAsyncAwaiter( explicit ViaIfAsyncAwaiter(
folly::Executor::KeepAlive<> executor, folly::Executor::KeepAlive<> executor,
Awaitable&& awaitable) Awaitable&& awaitable)
: viaCoroutine_(detail::ViaCoroutine::create(executor)), : viaCoroutine_(detail::ViaCoroutine::create(std::move(executor))),
awaiter_( awaiter_(
folly::coro::get_awaiter(static_cast<Awaitable&&>(awaitable))) {} folly::coro::get_awaiter(static_cast<Awaitable&&>(awaitable))) {}
...@@ -282,7 +282,8 @@ template <typename Awaitable> ...@@ -282,7 +282,8 @@ template <typename Awaitable>
auto operator co_await(ViaIfAsyncAwaitable<Awaitable>&& awaitable) auto operator co_await(ViaIfAsyncAwaitable<Awaitable>&& awaitable)
-> ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<Awaitable>> { -> ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<Awaitable>> {
return ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<Awaitable>>{ return ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<Awaitable>>{
awaitable.executor_, static_cast<Awaitable&&>(awaitable.awaitable_)}; std::move(awaitable.executor_),
static_cast<Awaitable&&>(awaitable.awaitable_)};
} }
template <typename Awaitable> template <typename Awaitable>
...@@ -296,7 +297,7 @@ template <typename Awaitable> ...@@ -296,7 +297,7 @@ template <typename Awaitable>
auto operator co_await(const ViaIfAsyncAwaitable<Awaitable>&& awaitable) auto operator co_await(const ViaIfAsyncAwaitable<Awaitable>&& awaitable)
-> ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<const Awaitable&&>> { -> ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<const Awaitable&&>> {
return ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<const Awaitable&&>>{ return ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<const Awaitable&&>>{
awaitable.executor_, std::move(awaitable.executor_),
static_cast<const Awaitable&&>(awaitable.awaitable_)}; static_cast<const Awaitable&&>(awaitable.awaitable_)};
} }
......
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