Index: Source/core/dom/MutationObserver.cpp |
diff --git a/Source/core/dom/MutationObserver.cpp b/Source/core/dom/MutationObserver.cpp |
index 848ad09584c35928a15bc0449eb79cb95c03231c..d06103e098b6389b07cfcc377e5ed6735f8c864b 100644 |
--- a/Source/core/dom/MutationObserver.cpp |
+++ b/Source/core/dom/MutationObserver.cpp |
@@ -156,8 +156,8 @@ void MutationObserver::disconnect() |
m_records.clear(); |
InspectorInstrumentation::didClearAllMutationRecords(m_callback->executionContext(), this); |
MutationObserverRegistrationSet registrations(m_registrations); |
- for (MutationObserverRegistrationSet::iterator iter = registrations.begin(); iter != registrations.end(); ++iter) |
- (*iter)->unregister(); |
+ for (auto& registration : registrations) |
+ registration->unregister(); |
ASSERT(m_registrations.isEmpty()); |
} |
@@ -210,8 +210,8 @@ void MutationObserver::setHasTransientRegistration() |
WillBeHeapHashSet<RawPtrWillBeMember<Node> > MutationObserver::getObservedNodes() const |
{ |
WillBeHeapHashSet<RawPtrWillBeMember<Node> > observedNodes; |
- for (MutationObserverRegistrationSet::const_iterator iter = m_registrations.begin(); iter != m_registrations.end(); ++iter) |
- (*iter)->addRegistrationNodesToSet(observedNodes); |
+ for (const auto& registration : m_registrations) |
+ registration->addRegistrationNodesToSet(observedNodes); |
return observedNodes; |
} |
@@ -227,9 +227,9 @@ void MutationObserver::deliver() |
// Calling clearTransientRegistrations() can modify m_registrations, so it's necessary |
// to make a copy of the transient registrations before operating on them. |
WillBeHeapVector<RawPtrWillBeMember<MutationObserverRegistration>, 1> transientRegistrations; |
- for (MutationObserverRegistrationSet::iterator iter = m_registrations.begin(); iter != m_registrations.end(); ++iter) { |
- if ((*iter)->hasTransientRegistrations()) |
- transientRegistrations.append(*iter); |
+ for (auto& registration : m_registrations) { |
+ if (registration->hasTransientRegistrations()) |
+ transientRegistrations.append(registration); |
} |
for (size_t i = 0; i < transientRegistrations.size(); ++i) |
transientRegistrations[i]->clearTransientRegistrations(); |