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

future/semifuture poll() - use ?:

Summary:
`{Future,SemiFuture}::poll()`:
- minor chg to impl from assignment to stateless ?:

Reviewed By: yfeldblum

Differential Revision: D7840466

fbshipit-source-id: 201dd7121b713324bb054b72c8ecdf6f4f163b97
parent f07d48a0
......@@ -243,11 +243,9 @@ void FutureBase<T>::throwIfInvalid() const {
template <class T>
Optional<Try<T>> FutureBase<T>::poll() {
Optional<Try<T>> o;
if (core_->ready()) {
o = std::move(core_->getTry());
}
return o;
auto& core = getCore();
return core.hasResult() ? Optional<Try<T>>(std::move(core.getTry()))
: Optional<Try<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