Bug 1229032 - don't copy arrays in PerformanceObserver::Observe; r=baku

Once we've sanitized the input data, there's no need to copy our
newly-allocated array into mEntryTypes; we can simply swap them and
avoid extra allocations.
This commit is contained in:
Nathan Froyd 2015-11-18 12:47:44 -05:00
parent 5ff39d1981
commit a06468e92d

View File

@ -168,7 +168,7 @@ PerformanceObserver::Observe(const PerformanceObserverInit& aOptions,
return;
}
mEntryTypes = validEntryTypes;
mEntryTypes.SwapElements(validEntryTypes);
mPerformance->AddObserver(this);
mConnected = true;