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() {
#if defined(OS_WIN)
InsertPolicyManager(std::make_unique<GroupPolicyManager>());
#endif
// TODO (crbug/1122118): Inject the DMPolicyManager here.
// TODO(crbug/1122118): Inject the DMPolicyManager here.
#if defined(OS_MAC)
InsertPolicyManager(CreateManagedPreferencePolicyManager());
#endif
......@@ -54,12 +54,10 @@ void PolicyService::SetPolicyManagersForTesting(
std::vector<std::unique_ptr<PolicyManagerInterface>> managers) {
// Testing managers are not inserted via InsertPolicyManager(). Do a
// quick sanity check that all managed providers are ahead of non-managed
// providers (there should be no adjacent pair with the reversed order).
DCHECK(std::adjacent_find(
managers.begin(), managers.end(),
[](const std::unique_ptr<PolicyManagerInterface>& first,
const std::unique_ptr<PolicyManagerInterface>& second) {
return !first->IsManaged() && second->IsManaged();
// providers: there should be no adjacent pair with the reversed order.
DCHECK(std::adjacent_find(managers.begin(), managers.end(),
[](const auto& fst, const auto& snd) {
return !fst->IsManaged() && snd->IsManaged();
}) == managers.end());
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