Some more loops.

Hmm...I think I see a refactoring opportunity.
This commit is contained in:
Jason Felds
2013-04-30 20:47:16 -04:00
parent ead42d5234
commit a6133c35c3
+6 -6
View File
@@ -236,8 +236,8 @@ void IMessageSubscriber::ClearMessages( const RString sMessage )
MessageSubscriber::MessageSubscriber( const MessageSubscriber &cpy ): MessageSubscriber::MessageSubscriber( const MessageSubscriber &cpy ):
IMessageSubscriber(cpy) IMessageSubscriber(cpy)
{ {
FOREACH_CONST( RString, cpy.m_vsSubscribedTo, msg ) for (RString const &msg : cpy.m_vsSubscribedTo)
this->SubscribeToMessage( *msg ); this->SubscribeToMessage( msg );
} }
MessageSubscriber &MessageSubscriber::operator=(const MessageSubscriber &cpy) MessageSubscriber &MessageSubscriber::operator=(const MessageSubscriber &cpy)
@@ -247,8 +247,8 @@ MessageSubscriber &MessageSubscriber::operator=(const MessageSubscriber &cpy)
UnsubscribeAll(); UnsubscribeAll();
FOREACH_CONST( RString, cpy.m_vsSubscribedTo, msg ) for (RString const &msg : cpy.m_vsSubscribedTo)
this->SubscribeToMessage( *msg ); this->SubscribeToMessage( msg );
return *this; return *this;
} }
@@ -267,8 +267,8 @@ void MessageSubscriber::SubscribeToMessage( MessageID message )
void MessageSubscriber::UnsubscribeAll() void MessageSubscriber::UnsubscribeAll()
{ {
FOREACH_CONST( RString, m_vsSubscribedTo, s ) for (RString const &s : m_vsSubscribedTo)
MESSAGEMAN->Unsubscribe( this, *s ); MESSAGEMAN->Unsubscribe( this, s );
m_vsSubscribedTo.clear(); m_vsSubscribedTo.clear();
} }