diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index f270ee7f818..1ff6a46ccb3 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -1736,11 +1736,9 @@ Future Future::within(Duration dur, E e, Timekeeper* tk) { return std::move(*this); } - auto* currentExecutor = this->getExecutor(); + auto* exe = this->getExecutor(); return this->withinImplementation(dur, e, tk) - .via( - currentExecutor ? currentExecutor - : &InlineExecutor::instance()); + .via(exe ? exe : &InlineExecutor::instance()); } // delayed @@ -1787,9 +1785,8 @@ void waitImpl(FutureType& f) { template void convertFuture(SemiFuture&& sf, Future& f) { // Carry executor from f, inserting an inline executor if it did not have one - auto* currentExecutor = f.getExecutor(); - f = std::move(sf).via( - currentExecutor ? currentExecutor : &InlineExecutor::instance()); + auto* exe = f.getExecutor(); + f = std::move(sf).via(exe ? exe : &InlineExecutor::instance()); } template