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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCollection.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLCollection.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCollection.cpp b/third_party/WebKit/Source/core/html/HTMLCollection.cpp
index 1606c2755ed2a9fd3061c40aa7798ec62289e538..74f3b7f53452fe1c35c228455e6812ce88de2b4d 100644
--- a/third_party/WebKit/Source/core/html/HTMLCollection.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCollection.cpp
@@ -512,13 +512,13 @@ void HTMLCollection::namedItems(const AtomicString& name,
const NamedItemCache& cache = namedItemCache();
if (HeapVector<Member<Element>>* idResults = cache.getElementsById(name)) {
- for (unsigned i = 0; i < idResults->size(); ++i)
- result.append(idResults->at(i));
+ for (const auto& element : *idResults)
+ result.append(element);
}
if (HeapVector<Member<Element>>* nameResults =
cache.getElementsByName(name)) {
- for (unsigned i = 0; i < nameResults->size(); ++i)
- result.append(nameResults->at(i));
+ for (const auto& element : *nameResults)
+ result.append(element);
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698