Commit 467571e4 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

A shorter name for executor local variable in Future methods

Summary:
[Folly] A shorter name for executor local variable in `Future` methods. Reads more nicely, with less awkward formatting.

When the scope of a local variable's use is just a few lines, long names are not quite so critical.

Reviewed By: marshallcline

Differential Revision: D8339451

fbshipit-source-id: 5d50cf0ce3473c1a79afeeddb9e1257cccf73e31
parent ac16a6fc
...@@ -1736,11 +1736,9 @@ Future<T> Future<T>::within(Duration dur, E e, Timekeeper* tk) { ...@@ -1736,11 +1736,9 @@ Future<T> Future<T>::within(Duration dur, E e, Timekeeper* tk) {
return std::move(*this); return std::move(*this);
} }
auto* currentExecutor = this->getExecutor(); auto* exe = this->getExecutor();
return this->withinImplementation(dur, e, tk) return this->withinImplementation(dur, e, tk)
.via( .via(exe ? exe : &InlineExecutor::instance());
currentExecutor ? currentExecutor
: &InlineExecutor::instance());
} }
// delayed // delayed
...@@ -1787,9 +1785,8 @@ void waitImpl(FutureType& f) { ...@@ -1787,9 +1785,8 @@ void waitImpl(FutureType& f) {
template <class T> template <class T>
void convertFuture(SemiFuture<T>&& sf, Future<T>& f) { void convertFuture(SemiFuture<T>&& sf, Future<T>& f) {
// Carry executor from f, inserting an inline executor if it did not have one // Carry executor from f, inserting an inline executor if it did not have one
auto* currentExecutor = f.getExecutor(); auto* exe = f.getExecutor();
f = std::move(sf).via( f = std::move(sf).via(exe ? exe : &InlineExecutor::instance());
currentExecutor ? currentExecutor : &InlineExecutor::instance());
} }
template <class T> template <class T>
......
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