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

Unified Diff: components/autofill/content/renderer/form_autofill_util.cc

Issue 2110663002: components: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 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/content/renderer/form_autofill_util.cc
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index 69e24c1cfdbfe7e0f77c2cfba02e4b72e43ee3f3..462474676779ec3a69883e2b980f155347e9aaa4 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -675,10 +675,9 @@ std::vector<std::string> AncestorTagNames(
bool IsLabelValid(base::StringPiece16 inferred_label,
const std::vector<base::char16>& stop_words) {
// If |inferred_label| has any character other than those in |stop_words|.
- auto first_non_stop_word = std::find_if(inferred_label.begin(),
- inferred_label.end(), [&stop_words](base::char16 c) {
- return !ContainsValue(stop_words, c);
- });
+ auto* first_non_stop_word = std::find_if(
+ inferred_label.begin(), inferred_label.end(),
+ [&stop_words](base::char16 c) { return !ContainsValue(stop_words, c); });
return first_non_stop_word != inferred_label.end();
}
@@ -1146,7 +1145,7 @@ bool FormOrFieldsetsToFormData(
}
// Copy the created FormFields into the resulting FormData object.
- for (const auto& iter : form_fields)
+ for (auto* iter : form_fields)
vabr (Chromium) 2016/07/19 07:54:08 optional: This could even be "const auto*".
vmpstr 2016/07/19 19:49:30 Done.
form->fields.push_back(*iter);
return true;
}
@@ -1551,7 +1550,7 @@ bool UnownedCheckoutFormElementsAndFieldSetsToFormData(
"wallet"
};
- for (const auto& keyword : kKeywords) {
+ for (auto* keyword : kKeywords) {
vabr (Chromium) 2016/07/19 07:54:08 nit: "const auto*" to emphasise that |keyword| poi
vmpstr 2016/07/19 19:49:30 Done.
// Compare char16 elements of |title| with char elements of |keyword| using
// operator==.
auto title_pos = std::search(title.begin(), title.end(),

Powered by Google App Engine
This is Rietveld 408576698