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

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: 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
« no previous file with comments | « components/autofill/core/browser/address.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c8a9510854ab1a3dce8ae9f39cdf064823feb506 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -16,6 +16,7 @@
#include "base/i18n/timezone.h"
#include "base/memory/ptr_util.h"
#include "base/profiler/scoped_tracker.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -1115,8 +1116,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));
}
const std::string& PersonalDataManager::GetDefaultCountryCodeForNewAddress()
@@ -1384,8 +1384,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;
}
« no previous file with comments | « components/autofill/core/browser/address.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698