Commit a0d1a964 authored by Sorin Jianu's avatar Sorin Jianu Committed by Chromium LUCI CQ

Use param type deduction for a lambda function.

This changes also the names of params from first/second to fst/snd
to avoid confusion with the std::pair members.

Bug: 1153907

Change-Id: I1a9f09b8442f3ed42fb5d02a57fd47b939ed7a4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2564486Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831939}
parent b3a5da19
...@@ -26,7 +26,7 @@ PolicyService::PolicyService() { ...@@ -26,7 +26,7 @@ PolicyService::PolicyService() {
#if defined(OS_WIN) #if defined(OS_WIN)
InsertPolicyManager(std::make_unique<GroupPolicyManager>()); InsertPolicyManager(std::make_unique<GroupPolicyManager>());
#endif #endif
// TODO (crbug/1122118): Inject the DMPolicyManager here. // TODO(crbug/1122118): Inject the DMPolicyManager here.
#if defined(OS_MAC) #if defined(OS_MAC)
InsertPolicyManager(CreateManagedPreferencePolicyManager()); InsertPolicyManager(CreateManagedPreferencePolicyManager());
#endif #endif
...@@ -54,13 +54,11 @@ void PolicyService::SetPolicyManagersForTesting( ...@@ -54,13 +54,11 @@ void PolicyService::SetPolicyManagersForTesting(
std::vector<std::unique_ptr<PolicyManagerInterface>> managers) { std::vector<std::unique_ptr<PolicyManagerInterface>> managers) {
// Testing managers are not inserted via InsertPolicyManager(). Do a // Testing managers are not inserted via InsertPolicyManager(). Do a
// quick sanity check that all managed providers are ahead of non-managed // quick sanity check that all managed providers are ahead of non-managed
// providers (there should be no adjacent pair with the reversed order). // providers: there should be no adjacent pair with the reversed order.
DCHECK(std::adjacent_find( DCHECK(std::adjacent_find(managers.begin(), managers.end(),
managers.begin(), managers.end(), [](const auto& fst, const auto& snd) {
[](const std::unique_ptr<PolicyManagerInterface>& first, return !fst->IsManaged() && snd->IsManaged();
const std::unique_ptr<PolicyManagerInterface>& second) { }) == managers.end());
return !first->IsManaged() && second->IsManaged();
}) == managers.end());
policy_managers_ = std::move(managers); policy_managers_ = std::move(managers);
} }
......
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