Revert "Reduce number of allocations in AutoStopwatch"

This reverts commit 3476c1d60ec29c5497123194acd7a9310b1023d2.
This commit is contained in:
wolfbeast 2019-01-29 00:40:24 +01:00 committed by Roy Tam
commit dce38e8d76
4 changed files with 11 additions and 25 deletions

View file

@ -1310,12 +1310,8 @@ nsPerformanceStatsService::GetResources(uint64_t* userTime,
void
nsPerformanceStatsService::NotifyJankObservers(const mozilla::Vector<uint64_t>& aPreviousJankLevels) {
// The move operation is generally constant time, unless `mPendingAlerts.length()` is very small, in which case it's
// fast anyway.
GroupVector alerts(Move(mPendingAlerts));
mPendingAlerts = GroupVector(); // Reconstruct after `Move`.
GroupVector alerts;
mPendingAlerts.swap(alerts);
if (!mPendingAlertsCollector) {
// We are shutting down.
return;