Bug 1645339 - Use range-based for with nsTObserverArray in dom/performance. r=baku

Differential Revision: https://phabricator.services.mozilla.com/D79502
This commit is contained in:
Simon Giesecke 2020-06-16 10:15:30 +00:00
parent 285eb33a09
commit d35ea0c25f

View File

@ -596,10 +596,9 @@ void Performance::QueueEntry(PerformanceEntry* aEntry) {
}
nsTObserverArray<PerformanceObserver*> interestedObservers;
nsTObserverArray<PerformanceObserver*>::ForwardIterator observerIt(
mObservers);
while (observerIt.HasMore()) {
PerformanceObserver* observer = observerIt.GetNext();
/// XXX We could use a NonObservingRange here and then
/// TransformIf(IntoNewArray).
for (PerformanceObserver* observer : mObservers.ForwardRange()) {
if (observer->ObservesTypeOfEntry(aEntry)) {
interestedObservers.AppendElement(observer);
}