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

Unified Diff: third_party/WebKit/Source/core/html/imports/HTMLImportTreeRoot.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/imports/HTMLImportTreeRoot.cpp
diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportTreeRoot.cpp b/third_party/WebKit/Source/core/html/imports/HTMLImportTreeRoot.cpp
index d23db10b4e87d4744c387a341278cab934fbd4cb..47e13292e594b79b8fe457502c14c32f689ee432 100644
--- a/third_party/WebKit/Source/core/html/imports/HTMLImportTreeRoot.cpp
+++ b/third_party/WebKit/Source/core/html/imports/HTMLImportTreeRoot.cpp
@@ -25,8 +25,8 @@ HTMLImportTreeRoot::HTMLImportTreeRoot(Document* document)
HTMLImportTreeRoot::~HTMLImportTreeRoot() {}
void HTMLImportTreeRoot::dispose() {
- for (size_t i = 0; i < m_imports.size(); ++i)
- m_imports[i]->dispose();
+ for (const auto& importChild : m_imports)
+ importChild->dispose();
m_imports.clear();
m_document = nullptr;
m_recalcTimer.stop();
@@ -67,8 +67,7 @@ HTMLImportChild* HTMLImportTreeRoot::add(HTMLImportChild* child) {
}
HTMLImportChild* HTMLImportTreeRoot::find(const KURL& url) const {
- for (size_t i = 0; i < m_imports.size(); ++i) {
- HTMLImportChild* candidate = m_imports[i].get();
+ for (const auto& candidate : m_imports) {
if (equalIgnoringFragmentIdentifier(candidate->url(), url))
return candidate;
}

Powered by Google App Engine
This is Rietveld 408576698