зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1263486 part 2 - Use nsCSSValue move assignment operator in nsCSSValue::Adopt(Pair)ListValue r=heycam
MozReview-Commit-ID: 2fTFNmtHxIP --HG-- extra : rebase_source : b9ed5d5a19488a7d5a6b8b48a52e8619672c945b
This commit is contained in:
Родитель
7bf700da8b
Коммит
0a4031e946
|
@ -11,6 +11,7 @@
|
|||
#include "mozilla/CSSStyleSheet.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/css/ImageLoader.h"
|
||||
#include "CSSCalc.h"
|
||||
#include "gfxFontConstants.h"
|
||||
|
@ -640,9 +641,7 @@ nsCSSValue::AdoptListValue(UniquePtr<nsCSSValueList> aValue)
|
|||
// We have to copy the first element since for owned lists the first
|
||||
// element should be an nsCSSValueList_heap object.
|
||||
SetListValue();
|
||||
// FIXME: If nsCSSValue gets a swap method or move assignment operator,
|
||||
// we should use that here to avoid allocating an extra value.
|
||||
mValue.mList->mValue = aValue->mValue;
|
||||
mValue.mList->mValue = Move(aValue->mValue);
|
||||
mValue.mList->mNext = aValue->mNext;
|
||||
aValue->mNext = nullptr;
|
||||
aValue.reset();
|
||||
|
@ -672,10 +671,8 @@ nsCSSValue::AdoptPairListValue(UniquePtr<nsCSSValuePairList> aValue)
|
|||
// We have to copy the first element, since for owned pair lists, the first
|
||||
// element should be an nsCSSValuePairList_heap object.
|
||||
SetPairListValue();
|
||||
// FIXME: If nsCSSValue gets a swap method or move assignment operator,
|
||||
// we should use that here to avoid allocating extra values.
|
||||
mValue.mPairList->mXValue = aValue->mXValue;
|
||||
mValue.mPairList->mYValue = aValue->mYValue;
|
||||
mValue.mPairList->mXValue = Move(aValue->mXValue);
|
||||
mValue.mPairList->mYValue = Move(aValue->mYValue);
|
||||
mValue.mPairList->mNext = aValue->mNext;
|
||||
aValue->mNext = nullptr;
|
||||
aValue.reset();
|
||||
|
|
Загрузка…
Ссылка в новой задаче