diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-05-03 08:52:32 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-05-03 08:52:32 -0400 |
commit | 9f620efa9dd60c5de6b7ea807d53bba922294726 (patch) | |
tree | f296457400e5edc4f50ba4a057d9fc81dcd1f5b9 /indra/llcommon/llcallbacklist.h | |
parent | 48e1979abaecc03af96e7e752e65c645083a4268 (diff) |
Make LLLater store target time in mHandles; ditch 2nd unordered_map.
Instead of maintaining a whole separate unordered_map to look up target times,
make room in the HandleMap entry for the target time. There's still
circularity, but the split into doAtTime1() and doAtTime2() resolves it: since
doAtTime2() accepts the mHandles iterator created by doAtTime1(), doAtTime2()
can simply store the new mQueue handle_type into the appropriate slot.
Also sprinkle in a few more override keywords for consistency.
Diffstat (limited to 'indra/llcommon/llcallbacklist.h')
-rw-r--r-- | indra/llcommon/llcallbacklist.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/indra/llcommon/llcallbacklist.h b/indra/llcommon/llcallbacklist.h index 17adb7f431..3ff1aad04e 100644 --- a/indra/llcommon/llcallbacklist.h +++ b/indra/llcommon/llcallbacklist.h @@ -241,10 +241,10 @@ private: // the heap aka priority queue queue_t mQueue; // handles we've returned that haven't yet canceled - using HandleMap = std::unordered_map<token_t, queue_t::handle_type>; + using HandleMap = std::unordered_map< + token_t, + std::pair<queue_t::handle_type, LLDate::timestamp>>; HandleMap mHandles; - using DoneMap = std::unordered_map<token_t, LLDate::timestamp>; - DoneMap mDoneTimes; token_t mToken{ 0 }; // While mQueue is non-empty, register for regular callbacks. LLCallbackList::temp_handle_t mLive; @@ -252,8 +252,8 @@ private: struct Periodic; // internal implementation for doAtTime() - DoneMap::iterator doAtTime1(LLDate::timestamp time); - handle_t doAtTime2(nullary_func_t callable, DoneMap::iterator iter); + HandleMap::iterator doAtTime1(LLDate::timestamp time); + handle_t doAtTime2(nullary_func_t callable, HandleMap::iterator iter); }; /*-------------------- legacy names in global namespace --------------------*/ |