diff options
| author | Callum Prentice <callum@lindenlab.com> | 2023-05-17 11:31:45 -0700 |
|---|---|---|
| committer | Callum Prentice <callum@lindenlab.com> | 2023-05-17 11:31:45 -0700 |
| commit | f45e888c903bc7a4953b2812e6c30721a4322d1b (patch) | |
| tree | dc76eefe00474e27ad2981f0d922fec617d1b9ad /indra/llcommon/llevent.cpp | |
| parent | 671978e3927bc3ba9fc34008bbb7efd6f07b6c81 (diff) | |
| parent | 5a70639b7992842a9f74ec81b11bac56608b8f2e (diff) | |
Some small tweaks after merge with Viewer release
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; |
