From 07ecb7d616797b37a9136872f410ba4a0382a269 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Mon, 11 Apr 2011 11:53:11 -0700 Subject: [PATCH] Don't need to de-iteratorize this one --- .../Plasma/PubUtilLib/plAvatar/plAGModifier.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp index 682be7d5..42fdc50e 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp @@ -227,12 +227,11 @@ plAGChannel * plAGModifier::MergeChannel(plAGApplicator *app, // DETACHCHANNEL hsBool plAGModifier::DetachChannel(plAGChannel * channel) { - size_t i = 0; - hsBool done = false; + plAppTable::iterator i = fApps.begin(); - for( ; i != fApps.size(); i++) + while( i != fApps.end() ) { - plAGApplicator *app = fApps[i]; + plAGApplicator *app = *i; plAGChannel *existingChannel = app->GetChannel(); if(existingChannel) { @@ -243,16 +242,16 @@ hsBool plAGModifier::DetachChannel(plAGChannel * channel) app->SetChannel(replacementChannel); if( ! replacementChannel && app->AutoDelete()) { - fApps.erase(fApps.begin()+i); - i--; + // Don't need to adjust the iterator since we're about to exit the loop + fApps.erase(i); delete app; } - done = true; - break; + return true; } } + ++i; } - return done; + return false; } // READ