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

Unified Diff: Source/core/dom/WeakNodeMap.cpp

Issue 796913002: Use C++11 range-based loop for core/clipboard, core/dom and core/testing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 11 months 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 | « Source/core/dom/ScriptedAnimationController.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/WeakNodeMap.cpp
diff --git a/Source/core/dom/WeakNodeMap.cpp b/Source/core/dom/WeakNodeMap.cpp
index 1c3ffe5448abab09717e5c272eee4da4c26c668a..b6838212f0c6e72a3669849aa37e0098cf41fe55 100644
--- a/Source/core/dom/WeakNodeMap.cpp
+++ b/Source/core/dom/WeakNodeMap.cpp
@@ -55,15 +55,15 @@ bool NodeToWeakNodeMaps::removedFromMap(Node* node, WeakNodeMap* map)
void NodeToWeakNodeMaps::nodeDestroyed(Node* node)
{
OwnPtr<NodeToWeakNodeMaps::MapList> maps = m_nodeToMapList.take(node);
- for (size_t i = 0; i < maps->size(); i++)
- (*maps)[i]->nodeDestroyed(node);
+ for (auto& map : *maps)
+ map->nodeDestroyed(node);
}
WeakNodeMap::~WeakNodeMap()
{
NodeToWeakNodeMaps& allMaps = NodeToWeakNodeMaps::instance();
- for (NodeToValue::iterator it = m_nodeToValue.begin(); it != m_nodeToValue.end(); ++it) {
- Node* node = it->key;
+ for (auto& map : m_nodeToValue) {
+ Node* node = map.key;
if (allMaps.removedFromMap(node, this))
node->clearFlag(Node::HasWeakReferencesFlag);
}
« no previous file with comments | « Source/core/dom/ScriptedAnimationController.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698