Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: components/password_manager/core/browser/http_password_store_migrator.cc

Issue 2774653006: Refactor Password Manager to use base::EraseIf (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/http_password_store_migrator.cc
diff --git a/components/password_manager/core/browser/http_password_store_migrator.cc b/components/password_manager/core/browser/http_password_store_migrator.cc
index db243cb6c3a8e930ee0e938dba47e9e5b67a2c73..4611457227ca8114704895c8a70259c8ae3e393a 100644
--- a/components/password_manager/core/browser/http_password_store_migrator.cc
+++ b/components/password_manager/core/browser/http_password_store_migrator.cc
@@ -5,6 +5,7 @@
#include "components/password_manager/core/browser/http_password_store_migrator.h"
#include "base/memory/weak_ptr.h"
+#include "base/stl_util.h"
#include "components/password_manager/core/browser/password_manager_client.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/browser/password_store.h"
@@ -74,13 +75,10 @@ void HttpPasswordStoreMigrator::OnHSTSQueryResult(bool is_hsts) {
void HttpPasswordStoreMigrator::ProcessPasswordStoreResults() {
// Android and PSL matches are ignored.
- results_.erase(
- std::remove_if(results_.begin(), results_.end(),
- [](const std::unique_ptr<autofill::PasswordForm>& form) {
- return form->is_affiliation_based_match ||
- form->is_public_suffix_match;
- }),
- results_.end());
+ base::EraseIf(
+ results_, [](const std::unique_ptr<autofill::PasswordForm>& form) {
+ return form->is_affiliation_based_match || form->is_public_suffix_match;
+ });
// Add the new credentials to the password store. The HTTP forms are
// removed iff |mode_| == MigrationMode::MOVE.

Powered by Google App Engine
This is Rietveld 408576698