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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.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/parser/HTMLConstructionSite.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
index c14205ed362668a2ff0c5168a02f709639dc24a4..f91c2ce2fa13e74f720308e8488a4ed36652142a 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -321,8 +321,8 @@ void HTMLConstructionSite::executeQueuedTasks() {
TaskQueue queue;
queue.swap(m_taskQueue);
- for (size_t i = 0; i < size; ++i)
- executeTask(queue[i]);
+ for (auto& task : queue)
+ executeTask(task);
// We might be detached now.
}
@@ -407,8 +407,7 @@ void HTMLConstructionSite::mergeAttributesFromTokenIntoElement(
if (token->attributes().isEmpty())
return;
- for (unsigned i = 0; i < token->attributes().size(); ++i) {
- const Attribute& tokenAttribute = token->attributes().at(i);
+ for (const auto& tokenAttribute : token->attributes()) {
if (element->attributesWithoutUpdate().findIndex(tokenAttribute.name()) ==
kNotFound)
element->setAttribute(tokenAttribute.name(), tokenAttribute.value());

Powered by Google App Engine
This is Rietveld 408576698