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

Unified Diff: components/password_manager/core/browser/form_fetcher_impl_unittest.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/form_fetcher_impl_unittest.cc
diff --git a/components/password_manager/core/browser/form_fetcher_impl_unittest.cc b/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
index e3e2806d3aee9c831a77b1e4147e8abc775c866f..90c36a90dbf9ad13e8a29391c28639b217517182 100644
--- a/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
+++ b/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
@@ -13,6 +13,7 @@
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/stl_util.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
@@ -60,12 +61,9 @@ class NameFilter : public StubCredentialsFilter {
std::vector<std::unique_ptr<PasswordForm>> FilterResults(
std::vector<std::unique_ptr<PasswordForm>> results) const override {
- results.erase(
- std::remove_if(results.begin(), results.end(),
- [this](const std::unique_ptr<PasswordForm>& form) {
- return !ShouldSave(*form);
- }),
- results.end());
+ base::EraseIf(results, [this](const std::unique_ptr<PasswordForm>& form) {
+ return !ShouldSave(*form);
+ });
return results;
}

Powered by Google App Engine
This is Rietveld 408576698