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

Folly coro: avoid KeepAlive copy in promise

Summary: This prevents one acquire/release.

Reviewed By: lewissbaker

Differential Revision: D20924353

fbshipit-source-id: 8c5135bd2ebc03b736b1ea3dbb385e01218cffbc
parent 007c0045
......@@ -40,7 +40,8 @@ class ViaCoroutine {
public:
class promise_type {
public:
promise_type(folly::Executor::KeepAlive<> executor) noexcept
// Passed as lvalue by compiler, but should have no other dependencies
promise_type(folly::Executor::KeepAlive<>& executor) noexcept
: executor_(std::move(executor)) {}
ViaCoroutine get_return_object() noexcept {
......
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