зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1626570 - Improve handling of copying arrays in dom/html/. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D73626
This commit is contained in:
Родитель
f458cd246a
Коммит
942d6510f3
|
@ -3486,13 +3486,17 @@ void HTMLMediaElement::UpdateOutputTrackSources() {
|
|||
}
|
||||
|
||||
// Then work out the differences.
|
||||
for (const auto& track :
|
||||
AutoTArray<RefPtr<MediaTrack>, 4>(mediaTracksToAdd)) {
|
||||
if (mOutputTrackSources.GetWeak(track->GetId())) {
|
||||
mediaTracksToAdd.RemoveElement(track);
|
||||
trackSourcesToRemove.RemoveElement(track->GetId());
|
||||
}
|
||||
}
|
||||
mediaTracksToAdd.RemoveElementsAt(
|
||||
std::remove_if(mediaTracksToAdd.begin(), mediaTracksToAdd.end(),
|
||||
[this, &trackSourcesToRemove](const auto& track) {
|
||||
const bool remove =
|
||||
mOutputTrackSources.GetWeak(track->GetId());
|
||||
if (remove) {
|
||||
trackSourcesToRemove.RemoveElement(track->GetId());
|
||||
}
|
||||
return remove;
|
||||
}),
|
||||
mediaTracksToAdd.end());
|
||||
|
||||
// First remove stale track sources.
|
||||
for (const auto& id : trackSourcesToRemove) {
|
||||
|
|
|
@ -113,7 +113,7 @@ void TimeRanges::Normalize(double aTolerance) {
|
|||
|
||||
normalized.AppendElement(current);
|
||||
|
||||
mRanges = normalized;
|
||||
mRanges = std::move(normalized);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ void TimeRanges::Intersection(const TimeRanges* aOtherRanges) {
|
|||
}
|
||||
}
|
||||
|
||||
mRanges = intersection;
|
||||
mRanges = std::move(intersection);
|
||||
}
|
||||
|
||||
TimeRanges::index_type TimeRanges::Find(double aTime,
|
||||
|
|
Загрузка…
Ссылка в новой задаче