diff options
author | Brad Linden <brad@lindenlab.com> | 2023-05-17 11:17:48 -0700 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2023-05-17 11:17:48 -0700 |
commit | 2f44377b3e98d60f1bd5b1a495c9a3aab9cfa450 (patch) | |
tree | 0c9b22edca280d8e2a2ef280360485c139c9b829 /indra/llcommon/llevent.cpp | |
parent | 4758355c599d1487c11884d3f700981e011cb7b7 (diff) | |
parent | 5a70639b7992842a9f74ec81b11bac56608b8f2e (diff) |
Merge remote-tracking branch 'origin/main' into DRTVWR-559
Diffstat (limited to 'indra/llcommon/llevent.cpp')
-rw-r--r-- | indra/llcommon/llevent.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/indra/llcommon/llevent.cpp b/indra/llcommon/llevent.cpp index 633df01588..501d06e3cd 100644 --- a/indra/llcommon/llevent.cpp +++ b/indra/llcommon/llevent.cpp @@ -203,10 +203,9 @@ void LLSimpleDispatcher::removeListener(LLEventListener* listener) std::vector<LLListenerEntry> LLSimpleDispatcher::getListeners() const { std::vector<LLListenerEntry> ret; - std::vector<LLListenerEntry>::const_iterator itor; - for (itor=mListeners.begin(); itor!=mListeners.end(); ++itor) + for (const LLListenerEntry& entry : mListeners) { - ret.push_back(*itor); + ret.push_back(entry); } return ret; @@ -215,14 +214,12 @@ std::vector<LLListenerEntry> LLSimpleDispatcher::getListeners() const // virtual bool LLSimpleDispatcher::fireEvent(LLPointer<LLEvent> event, LLSD filter) { - std::vector<LLListenerEntry>::iterator itor; std::string filter_string = filter.asString(); - for (itor=mListeners.begin(); itor!=mListeners.end(); ++itor) + for (LLListenerEntry& entry : mListeners) { - LLListenerEntry& entry = *itor; if (filter_string == "" || entry.filter.asString() == filter_string) { - (entry.listener)->handleEvent(event, (*itor).userdata); + (entry.listener)->handleEvent(event, entry.userdata); } } return true; @@ -276,10 +273,9 @@ void LLSimpleListener::clearDispatchers() bool LLSimpleListener::handleAttach(LLEventDispatcher *dispatcher) { // Add dispatcher if it doesn't already exist - std::vector<LLEventDispatcher *>::iterator itor; - for (itor = mDispatchers.begin(); itor != mDispatchers.end(); ++itor) + for (LLEventDispatcher* disp : mDispatchers) { - if ((*itor) == dispatcher) return true; + if (disp == dispatcher) return true; } mDispatchers.push_back(dispatcher); return true; |