| Index: components/autofill/core/browser/autofill_profile_comparator.cc
|
| diff --git a/components/autofill/core/browser/autofill_profile_comparator.cc b/components/autofill/core/browser/autofill_profile_comparator.cc
|
| index c3e8709549b5c35931ddfb481c676167c9812f76..26869e22a910b3f59f6bcc3fb632c14ef739fe78 100644
|
| --- a/components/autofill/core/browser/autofill_profile_comparator.cc
|
| +++ b/components/autofill/core/browser/autofill_profile_comparator.cc
|
| @@ -9,7 +9,6 @@
|
|
|
| #include "base/i18n/case_conversion.h"
|
| #include "base/i18n/char_iterator.h"
|
| -#include "base/strings/string_piece.h"
|
| #include "base/strings/string_split.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/utf_string_conversion_utils.h"
|
| @@ -667,7 +666,7 @@ std::set<base::string16> AutofillProfileComparator::GetNamePartVariants(
|
| const base::string16& name_part) {
|
| const size_t kMaxSupportedSubNames = 8;
|
|
|
| - std::vector<base::string16> sub_names = base::SplitString(
|
| + std::vector<base::StringPiece16> sub_names = base::SplitStringPiece(
|
| name_part, kSpace, base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
|
|
| // Limit the number of sub-names we support (to constrain memory usage);
|
| @@ -680,7 +679,7 @@ std::set<base::string16> AutofillProfileComparator::GetNamePartVariants(
|
| // For each sub-name, add a variant of all the already existing variants that
|
| // appends this sub-name and one that appends the initial of this sub-name.
|
| // Duplicates will be discarded when they're added to the variants set.
|
| - for (const base::string16& sub_name : sub_names) {
|
| + for (auto sub_name : sub_names) {
|
| if (sub_name.empty())
|
| continue;
|
| std::vector<base::string16> new_variants;
|
| @@ -696,7 +695,7 @@ std::set<base::string16> AutofillProfileComparator::GetNamePartVariants(
|
| // As a common case, also add the variant that just concatenates all of the
|
| // initials.
|
| base::string16 initials;
|
| - for (const base::string16& sub_name : sub_names) {
|
| + for (auto sub_name : sub_names) {
|
| if (sub_name.empty())
|
| continue;
|
| initials.push_back(sub_name[0]);
|
| @@ -720,12 +719,12 @@ bool AutofillProfileComparator::IsNameVariantOf(
|
| GetNamePartVariants(name_1_parts.given);
|
| const std::set<base::string16> middle_name_variants =
|
| GetNamePartVariants(name_1_parts.middle);
|
| - const base::string16& family_name = name_1_parts.family;
|
| + base::StringPiece16 family_name = name_1_parts.family;
|
|
|
| // Iterate over all full name variants of profile 2 and see if any of them
|
| // match the full name from profile 1.
|
| - for (const base::string16& given_name : given_name_variants) {
|
| - for (const base::string16& middle_name : middle_name_variants) {
|
| + for (base::StringPiece16 given_name : given_name_variants) {
|
| + for (base::StringPiece16 middle_name : middle_name_variants) {
|
| base::string16 candidate = base::CollapseWhitespace(
|
| base::JoinString({given_name, middle_name, family_name}, kSpace),
|
| true);
|
|
|