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

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

Issue 2417783004: Replace for loops with |arraysize| with for each loops (Closed)
Patch Set: Created 4 years, 2 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_cache.cc
diff --git a/components/autofill/content/renderer/form_cache.cc b/components/autofill/content/renderer/form_cache.cc
index 0ff07229ed661ac48169382c8d6f28bc9fd18043..7a2297f7b182a623943c3e430287bd7c8b96bcea 100644
--- a/components/autofill/content/renderer/form_cache.cc
+++ b/components/autofill/content/renderer/form_cache.cc
@@ -45,10 +45,10 @@ void LogDeprecationMessages(const WebFormControlElement& element) {
element.getAttribute("autocomplete")));
static const char* const deprecated[] = { "region", "locality" };
- for (size_t i = 0; i < arraysize(deprecated); ++i) {
- if (autocomplete_attribute.find(deprecated[i]) == std::string::npos)
+ for (const auto& str : deprecated) {
vabr (Chromium) 2016/10/17 07:40:33 When |str| is a pointer, we prefer to spell it out
jdoerrie 2016/10/17 08:42:27 Done.
+ if (autocomplete_attribute.find(str) == std::string::npos)
continue;
- std::string msg = std::string("autocomplete='") + deprecated[i] +
+ std::string msg = std::string("autocomplete='") + str +
"' is deprecated and will soon be ignored. See http://goo.gl/YjeSsW";
WebConsoleMessage console_message = WebConsoleMessage(
WebConsoleMessage::LevelWarning,

Powered by Google App Engine
This is Rietveld 408576698