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

Apply clang-format to folly/fibers/

Summary: [Folly] Apply `clang-format` to `folly/fibers/`.

Reviewed By: igorsugak

Differential Revision: D9625725

fbshipit-source-id: e00f6406db994a1a3f17c1d23b415bea13495e99
parent fa256453
......@@ -94,7 +94,7 @@ void TaskIterator<T>::addTask(F&& func) {
auto taskId = context_->totalTasks++;
fm_.addTask(
[ taskId, context = context_, func = std::forward<F>(func) ]() mutable {
[taskId, context = context_, func = std::forward<F>(func)]() mutable {
context->results.emplace_back(
taskId, folly::makeTryWith(std::move(func)));
......
......@@ -31,7 +31,7 @@ auto FiberManager::addTaskFuture(F&& func)
auto f = p.getFuture();
addTaskFinally(
[func = std::forward<F>(func)]() mutable { return func(); },
[p = std::move(p)](folly::Try<T> && t) mutable {
[p = std::move(p)](folly::Try<T>&& t) mutable {
p.setTry(std::move(t));
});
return f;
......@@ -43,7 +43,7 @@ auto FiberManager::addTaskRemoteFuture(F&& func)
folly::Promise<typename folly::lift_unit<invoke_result_t<F>>::type> p;
auto f = p.getFuture();
addTaskRemote(
[ p = std::move(p), func = std::forward<F>(func), this ]() mutable {
[p = std::move(p), func = std::forward<F>(func), this]() mutable {
auto t = folly::makeTryWith(std::forward<F>(func));
runInMainContext([&]() { p.setTry(std::move(t)); });
});
......
......@@ -50,14 +50,12 @@ inline void forEach(InputIterator first, InputIterator last, F&& f) {
Baton baton;
auto taskFunc = [&tasksTodo, &e, &f, &baton](size_t id, FuncType&& func) {
return [
id,
&tasksTodo,
&e,
&f,
&baton,
func_ = std::forward<FuncType>(func)
]() mutable {
return [id,
&tasksTodo,
&e,
&f,
&baton,
func_ = std::forward<FuncType>(func)]() mutable {
try {
callFuncs(std::forward<FuncType>(func_), f, id);
} catch (...) {
......
......@@ -54,7 +54,7 @@ collectN(InputIterator first, InputIterator last, size_t n) {
await([first, last, context](Promise<void> promise) mutable {
context->promise = std::move(promise);
for (size_t i = 0; first != last; ++i, ++first) {
addTask([ i, context, f = std::move(*first) ]() {
addTask([i, context, f = std::move(*first)]() {
try {
auto result = f();
if (context->tasksTodo == 0) {
......@@ -108,7 +108,7 @@ collectN(InputIterator first, InputIterator last, size_t n) {
await([first, last, context](Promise<void> promise) mutable {
context->promise = std::move(promise);
for (size_t i = 0; first != last; ++i, ++first) {
addTask([ i, context, f = std::move(*first) ]() {
addTask([i, context, f = std::move(*first)]() {
try {
f();
if (context->tasksTodo == 0) {
......
......@@ -341,9 +341,8 @@ TEST(FiberManager, awaitThrow) {
EXPECT_THROW(
await([&](Promise<int> p) {
evb.runInEventBaseThread([p = std::move(p)]() mutable {
p.setValue(42);
});
evb.runInEventBaseThread(
[p = std::move(p)]() mutable { p.setValue(42); });
throw ExpectedException();
}),
ExpectedException);
......
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