Bug 1203350 - Unify arithmetic operators in TimeStamp; r=froydnj

This commit is contained in:
Brian Birtles 2015-09-11 15:02:04 +09:00
parent f1b5ccb184
commit 79d3dd88b7

View File

@ -491,13 +491,15 @@ public:
TimeStamp operator+(const TimeDuration& aOther) const
{
MOZ_ASSERT(!IsNull(), "Cannot compute with a null value");
return TimeStamp(mValue + aOther.mValue);
TimeStamp result = *this;
result += aOther;
return result;
}
TimeStamp operator-(const TimeDuration& aOther) const
{
MOZ_ASSERT(!IsNull(), "Cannot compute with a null value");
return TimeStamp(mValue - aOther.mValue);
TimeStamp result = *this;
result -= aOther;
return result;
}
TimeStamp& operator+=(const TimeDuration& aOther)
{