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

Unified Diff: components/autofill/core/browser/address.cc

Issue 2972333002: autofill : Use ContainsValue() instead of std::find() in components/autofill (Closed)
Patch Set: add base/stl_util.h Created 3 years, 5 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/autofill/core/browser/address.cc
diff --git a/components/autofill/core/browser/address.cc b/components/autofill/core/browser/address.cc
index 3a44121606db624caf2320cff7e3a38693ea1e75..c950f69c277496c37234f5024f0ec8cfd8d4ee1b 100644
--- a/components/autofill/core/browser/address.cc
+++ b/components/autofill/core/browser/address.cc
@@ -9,6 +9,7 @@
#include "base/i18n/case_conversion.h"
#include "base/logging.h"
+#include "base/stl_util.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -199,8 +200,7 @@ bool Address::SetInfo(const AutofillType& type,
// There's a good chance that this formatting is not intentional, but it's
// also not obviously safe to just strip the newlines.
if (storable_type == ADDRESS_HOME_STREET_ADDRESS &&
- std::find(street_address_.begin(), street_address_.end(),
- base::string16()) != street_address_.end()) {
+ base::ContainsValue(street_address_, base::string16())) {
street_address_.clear();
return false;
}

Powered by Google App Engine
This is Rietveld 408576698