mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1147555 - Invert the ordering of our priority queue. r=mattwoodrow
This commit is contained in:
parent
b05a2ce963
commit
97cc33ac66
@ -111,7 +111,9 @@ MediaTimer::UpdateLocked()
|
||||
TimeStamp now = TimeStamp::Now();
|
||||
while (!mEntries.empty() && mEntries.top().mTimeStamp <= now) {
|
||||
mEntries.top().mPromise->Resolve(true, __func__);
|
||||
DebugOnly<TimeStamp> poppedTimeStamp = mEntries.top().mTimeStamp;
|
||||
mEntries.pop();
|
||||
MOZ_ASSERT_IF(!mEntries.empty(), *&poppedTimeStamp <= mEntries.top().mTimeStamp);
|
||||
}
|
||||
|
||||
// If we've got no more entries, cancel any pending timer and bail out.
|
||||
|
@ -78,9 +78,12 @@ private:
|
||||
, mPromise(new MediaTimerPromise::Private(aCallSite))
|
||||
{}
|
||||
|
||||
// Define a < overload that reverses ordering because std::priority_queue
|
||||
// provides access to the largest element, and we want the smallest
|
||||
// (i.e. the soonest).
|
||||
bool operator<(const Entry& aOther) const
|
||||
{
|
||||
return mTimeStamp < aOther.mTimeStamp;
|
||||
return mTimeStamp > aOther.mTimeStamp;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user