summaryrefslogtreecommitdiff
path: root/src/net/network.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-24 20:15:19 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-24 20:15:19 +0000
commit1c4742e530271e10ae949cf7e85402bee867e298 (patch)
treef95927614c4f9a84a507c9425b882f945be6d09f /src/net/network.cpp
parent05a12d5568111fa13759026442ed358605bf9a28 (diff)
downloadmana-1c4742e530271e10ae949cf7e85402bee867e298.tar.gz
mana-1c4742e530271e10ae949cf7e85402bee867e298.tar.bz2
mana-1c4742e530271e10ae949cf7e85402bee867e298.tar.xz
mana-1c4742e530271e10ae949cf7e85402bee867e298.zip
Another bunch of cosmetic cleanups, ie mostly typedefs...
Diffstat (limited to 'src/net/network.cpp')
-rw-r--r--src/net/network.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/net/network.cpp b/src/net/network.cpp
index 9e6f6621..366d07d9 100644
--- a/src/net/network.cpp
+++ b/src/net/network.cpp
@@ -182,17 +182,9 @@ void Network::registerHandler(MessageHandler *handler)
void Network::unregisterHandler(MessageHandler *handler)
{
- const Uint16 *i = handler->handledMessages;
-
- while(*i)
+ for (const Uint16 *i = handler->handledMessages; *i; i++)
{
- std::map<Uint16, MessageHandler*>::iterator iter;
- iter = mMessageHandlers.find(*i);
- if (iter != mMessageHandlers.end())
- {
- mMessageHandlers.erase(iter);
- }
- i++;
+ mMessageHandlers.erase(*i);
}
handler->setNetwork(0);
@@ -200,7 +192,7 @@ void Network::unregisterHandler(MessageHandler *handler)
void Network::clearHandlers()
{
- std::map<Uint16, MessageHandler*>::iterator i;
+ MessageHandlerIterator i;
for (i = mMessageHandlers.begin(); i != mMessageHandlers.end(); i++)
{
i->second->setNetwork(0);
@@ -214,8 +206,7 @@ void Network::dispatchMessages()
{
MessageIn msg = getNextMessage();
- std::map<Uint16, MessageHandler*>::iterator iter;
- iter = mMessageHandlers.find(msg.getId());
+ MessageHandlerIterator iter = mMessageHandlers.find(msg.getId());
if (iter != mMessageHandlers.end())
iter->second->handleMessage(&msg);