Bug 834929 - Part 3: Squeeze two members of Event into a union to reduce its size; r=roc

This commit is contained in:
Ehsan Akhgari 2013-01-28 15:40:12 -05:00
Родитель 495612118f
Коммит 78a045cb78
1 изменённых файлов: 15 добавлений и 8 удалений

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

@ -39,13 +39,16 @@ private:
Event(Type aType, double aTime, float aValue, double aTimeConstant = 0.0,
float aDuration = 0.0, float* aCurve = nullptr, uint32_t aCurveLength = 0)
: mType(aType)
, mValue(aValue)
, mTime(aTime)
, mTimeConstant(aTimeConstant)
, mDuration(aDuration)
, mCurve(aCurve)
, mCurveLength(aCurveLength)
{
if (aType == Event::SetValueCurve) {
mCurve = aCurve;
mCurveLength = aCurveLength;
} else {
mValue = aValue;
mTime = aTime;
}
}
bool IsValid() const
@ -57,12 +60,16 @@ private:
}
Type mType;
union {
float mValue;
uint32_t mCurveLength;
};
union {
double mTime;
float* mCurve;
};
double mTimeConstant;
double mDuration;
float* mCurve;
uint32_t mCurveLength;
private:
static bool IsValid(float value)