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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLFormattingElementList.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/HTMLFormattingElementList.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLFormattingElementList.cpp b/third_party/WebKit/Source/core/html/parser/HTMLFormattingElementList.cpp
index 392fcd8ce16f303ef7bbe722678e49f145368140..2fcba8b114d3f20a9baf6395e7b9fe65a1fd55ee 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLFormattingElementList.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLFormattingElementList.cpp
@@ -166,13 +166,8 @@ void HTMLFormattingElementList::ensureNoahsArkCondition(
HeapVector<Member<HTMLStackItem>> remainingCandidates;
remainingCandidates.reserveInitialCapacity(candidates.size());
- const Vector<Attribute>& attributes = newItem->attributes();
- for (size_t i = 0; i < attributes.size(); ++i) {
- const Attribute& attribute = attributes[i];
-
- for (size_t j = 0; j < candidates.size(); ++j) {
- HTMLStackItem* candidate = candidates[j];
-
+ for (const auto& attribute : newItem->attributes()) {
+ for (const auto& candidate : candidates) {
// These properties should already have been checked by
// tryToEnsureNoahsArkConditionQuickly.
ASSERT(newItem->attributes().size() == candidate->attributes().size());

Powered by Google App Engine
This is Rietveld 408576698