summaryrefslogtreecommitdiff
path: root/indra/llcommon/llevent.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-06-01 09:57:57 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-06-01 09:57:57 -0400
commitd844da2a6c5fc1a75e606150bb070fdb787698d3 (patch)
tree349ecda36a5a561d6e564e2cc3db39121fd8946b /indra/llcommon/llevent.cpp
parent8a74efa38ba631be5400c4912a6339310968c9d7 (diff)
parent7d05ade3f10563e8c202106e00cb3d273ab13338 (diff)
SL-18330: Merge branch 'xcode-14.3' into fix-monterey
to pick up new merge from main.
Diffstat (limited to 'indra/llcommon/llevent.cpp')
-rw-r--r--indra/llcommon/llevent.cpp16
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;