Part 4 could not suck more.

Part 4 could not suck more.

Sigh..

do_CreateInstance where was this defined so identifier is found..
This commit is contained in:
win7-7 2024-05-16 01:58:11 +03:00 committed by wuggy
commit 436a8d5697
2 changed files with 27 additions and 20 deletions

View file

@ -85,7 +85,7 @@ private:
class Entry final : public nsTimerImplHolder
{
const TimeStamp mTimeout;
TimeStamp mTimeout;
public:
Entry(const TimeStamp& aMinTimeout, const TimeStamp& aTimeout,
@ -110,16 +110,23 @@ private:
return mTimerImpl.forget();
}
static bool
UniquePtrLessThan(UniquePtr<Entry>& aLeft, UniquePtr<Entry>& aRight)
Entry(Entry&& aRight) = default;
Entry& operator=(Entry&& aRight) = default;
bool operator<(const Entry& aRight) const
{
// This is reversed because std::push_heap() sorts the "largest" to
// the front of the heap. We want that to be the earliest timer.
return aRight->mTimeout < aLeft->mTimeout;
// Reverse logic since we are inserting into a max heap
// that sorts the "largest" value to index 0.
return mTimeout > aRight.mTimeout;
}
bool operator==(const Entry& aRight) const
{
return mTimeout == aRight.mTimeout;
}
};
nsTArray<UniquePtr<Entry>> mTimers;
nsTArray<Entry> mTimers;
};
struct TimerAdditionComparator