Bug 1512678 - Simplify handling of previousBaseStyles in KeyframeEffect::EnsureBaseStyles; r=hiro

This should avoid a sometimes unnecessary heaps allocation and also avoids the
possibility of having a "none" previousBaseStyles.

Differential Revision: https://phabricator.services.mozilla.com/D13984

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Birtles 2018-12-07 17:28:29 +00:00
Родитель 22c96f2cb4
Коммит 1a15db9fdd
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -374,9 +374,9 @@ void KeyframeEffect::EnsureBaseStyles(
return;
}
Maybe<BaseValuesHashmap> previousBaseStyles;
BaseValuesHashmap previousBaseStyles;
if (aBaseStylesChanged != nullptr) {
previousBaseStyles.emplace(std::move(mBaseValues));
previousBaseStyles = std::move(mBaseValues);
}
mBaseValues.Clear();
@ -405,7 +405,7 @@ void KeyframeEffect::EnsureBaseStyles(
if (aBaseStylesChanged != nullptr) {
for (auto iter = mBaseValues.Iter(); !iter.Done(); iter.Next()) {
if (AnimationValue(iter.Data()) !=
AnimationValue(previousBaseStyles->Get(iter.Key()))) {
AnimationValue(previousBaseStyles.Get(iter.Key()))) {
*aBaseStylesChanged = true;
break;
}