Commit d6c0e8e7 authored by Hannes Roth's avatar Hannes Roth Committed by woo

(Wangle) Don't add an extra value() call for makeFuture(Try)

Summary: Not sure why we'd need that? This avoids a move, I think.

Test Plan:
Run all the tests. Also unbreaks this code, which used to work at some
point.
https://phabricator.fb.com/diffusion/FBCODE/browse/master/taoThriftService/TaoServiceHandler.cpp;a27bc2ef36cd671d65ae0fd2cc1fb1f823e68ae4$246

Reviewed By: hans@fb.com

Subscribers: trunkagent, folly-diffs@, jsedgwick

FB internal diff: D1800619

Signature: t1:1800619:1422053903:f9e65a0be3d820a9a9989b3cf5dfaf2a61e2e900
parent ebdc61b7
......@@ -497,11 +497,9 @@ makeFuture(E const& e) {
template <class T>
Future<T> makeFuture(Try<T>&& t) {
if (t.hasException()) {
return makeFuture<T>(std::move(t.exception()));
} else {
return makeFuture<T>(std::move(t.value()));
}
Promise<typename std::decay<T>::type> p;
p.fulfilTry(std::move(t));
return p.getFuture();
}
template <>
......
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