Commit 9a474aec authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Fix -Werror,-Wshadow-uncaptured-local errors

Summary: Fix -Werror,-Wshadow-uncaptured-local errors

Reviewed By: yfeldblum, iahs

Differential Revision: D27052090

fbshipit-source-id: 843bf9374ff16bfe422ef78e889f1c1286335c1a
parent b4f7d822
...@@ -221,8 +221,8 @@ auto makeUnorderedAsyncGeneratorFromAwaitableRangeImpl( ...@@ -221,8 +221,8 @@ auto makeUnorderedAsyncGeneratorFromAwaitableRangeImpl(
AsyncScope& scope, InputRange awaitables, IsTry) { AsyncScope& scope, InputRange awaitables, IsTry) {
using Item = using Item =
async_generator_from_awaitable_range_item_t<InputRange, IsTry::value>; async_generator_from_awaitable_range_item_t<InputRange, IsTry::value>;
return [](AsyncScope& scope, return [](AsyncScope& scopeParam,
InputRange awaitables) -> AsyncGenerator<Item&&> { InputRange awaitablesParam) -> AsyncGenerator<Item&&> {
auto [results, pipe] = AsyncPipe<Item, false>::create(); auto [results, pipe] = AsyncPipe<Item, false>::create();
const CancellationSource cancelSource; const CancellationSource cancelSource;
auto guard = folly::makeGuard([&] { cancelSource.requestCancellation(); }); auto guard = folly::makeGuard([&] { cancelSource.requestCancellation(); });
...@@ -234,15 +234,16 @@ auto makeUnorderedAsyncGeneratorFromAwaitableRangeImpl( ...@@ -234,15 +234,16 @@ auto makeUnorderedAsyncGeneratorFromAwaitableRangeImpl(
// context. // context.
const auto context = RequestContext::saveContext(); const auto context = RequestContext::saveContext();
for (auto&& semiAwaitable : static_cast<InputRange&&>(awaitables)) { for (auto&& semiAwaitable : static_cast<InputRange&&>(awaitablesParam)) {
scope.add( scopeParam.add(
[](auto semiAwaitable, [](auto semiAwaitableParam,
auto& cancelSource, auto& cancelSourceParam,
auto& pipe) -> Task<void> { auto& pipe) -> Task<void> {
auto result = co_await co_withCancellation( auto result = co_await co_withCancellation(
cancelSource.getToken(), co_awaitTry(std::move(semiAwaitable))); cancelSourceParam.getToken(),
co_awaitTry(std::move(semiAwaitableParam)));
if (!result.hasValue() && !IsTry::value) { if (!result.hasValue() && !IsTry::value) {
cancelSource.requestCancellation(); cancelSourceParam.requestCancellation();
} }
pipe.write(std::move(result)); pipe.write(std::move(result));
}(static_cast<decltype(semiAwaitable)&&>(semiAwaitable), }(static_cast<decltype(semiAwaitable)&&>(semiAwaitable),
......
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