Commit 5b1c46fb authored by Lee Howes's avatar Lee Howes Committed by Facebook Github Bot

Remove Promise::getFuture from Future-inl.h 4/4 - window

Summary: Modify folly::window to replace Promise::getFuture calls with Promise::getSemiFuture. The requirement for an executor on the semifuture here meant that I had to modify all of the SemiFutures with an executor in the vector. This may come with a small performance hit in some cases, but appears to be behaviourally better.

Reviewed By: yfeldblum

Differential Revision: D7104920

fbshipit-source-id: 7d105df553c28bb362b37ff64270ee16bf59fbd6
parent 9af220fa
...@@ -1399,7 +1399,7 @@ window(Executor* executor, Collection input, F func, size_t n) { ...@@ -1399,7 +1399,7 @@ window(Executor* executor, Collection input, F func, size_t n) {
std::vector<Future<Result>> futures; std::vector<Future<Result>> futures;
futures.reserve(ctx->promises.size()); futures.reserve(ctx->promises.size());
for (auto& promise : ctx->promises) { for (auto& promise : ctx->promises) {
futures.emplace_back(promise.getFuture()); futures.emplace_back(promise.getSemiFuture().via(executor));
} }
return futures; return futures;
......
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