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

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

Issue 2972333002: autofill : Use ContainsValue() instead of std::find() in components/autofill (Closed)
Patch Set: 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/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index 8039bc4e6013783e6b65278799583dedbcbec2c9..3987ba1ff274f1c690bfd05d57d6828da2cc5566 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1115,8 +1115,7 @@ bool PersonalDataManager::IsCountryOfInterest(const std::string& country_code)
AutofillCountry::CountryCodeForLocale(app_locale())));
}
- return std::find(country_codes.begin(), country_codes.end(),
- base::ToLowerASCII(country_code)) != country_codes.end();
+ return base::ContainsValue(country_codes, base::ToLowerASCII(country_code));
vabr (Chromium) 2017/07/09 18:23:59 Please also #include "base/stl_util.h" in this fil
deejay 2017/07/10 03:47:16 Done.
}
const std::string& PersonalDataManager::GetDefaultCountryCodeForNewAddress()
@@ -1384,8 +1383,7 @@ std::string PersonalDataManager::MostCommonCountryCodeFromProfiles() const {
std::string country_code = base::ToUpperASCII(base::UTF16ToASCII(
profiles[i]->GetRawInfo(ADDRESS_HOME_COUNTRY)));
- if (std::find(country_codes.begin(), country_codes.end(), country_code) !=
- country_codes.end()) {
+ if (base::ContainsValue(country_codes, country_code)) {
// Verified profiles count 100x more than unverified ones.
votes[country_code] += profiles[i]->IsVerified() ? 100 : 1;
}

Powered by Google App Engine
This is Rietveld 408576698