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

Unified Diff: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp

Issue 2556043002: Avoid WTF::Vector::at() and operator[] in core/html. (Closed)
Patch Set: _ Created 4 years 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: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
index 1d9e8541a2f42b60d94b78d5b3392009bc5f9eff..aebef280f2581ce6312904903c6d090ab45d43ab 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
@@ -480,9 +480,8 @@ void HTMLTextAreaElement::setDefaultValue(const String& defaultValue) {
if (n->isTextNode())
textNodes.append(n);
}
- size_t size = textNodes.size();
- for (size_t i = 0; i < size; ++i)
- removeChild(textNodes[i].get(), IGNORE_EXCEPTION);
+ for (const auto& text : textNodes)
+ removeChild(text.get(), IGNORE_EXCEPTION);
// Normalize line endings.
String value = defaultValue;

Powered by Google App Engine
This is Rietveld 408576698