summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-07-01 20:05:40 +0200
committerRobin Burchell <robin+git@viroteck.net>2012-07-01 21:06:03 +0200
commit34b2dde776b332116d04cea356843b324ab099fb (patch)
treebd07b4d13be1a517dffa4bfdb332108657cfbc53 /src/modules
parent038b550c832ca890ae0adbac15b824debb644c9f (diff)
m_callerid Use std::find() where possible
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_callerid.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index c541f806b..44fe5f9e6 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -118,14 +118,9 @@ struct CallerIDExtInfo : public ExtensionItem
if (!targ)
continue; // shouldn't happen, but oh well.
- for (std::list<callerid_data *>::iterator it2 = targ->wholistsme.begin(); it2 != targ->wholistsme.end(); it2++)
- {
- if (*it2 == dat)
- {
- targ->wholistsme.erase(it2);
- break;
- }
- }
+ std::list<callerid_data*>::iterator it2 = std::find(targ->wholistsme.begin(), targ->wholistsme.end(), dat);
+ if (it2 != targ->wholistsme.end())
+ targ->wholistsme.erase(it2);
}
}
};
@@ -300,15 +295,10 @@ public:
return false;
}
- for (std::list<callerid_data *>::iterator it = dat2->wholistsme.begin(); it != dat2->wholistsme.end(); it++)
- {
+ std::list<callerid_data*>::iterator it = std::find(dat2->wholistsme.begin(), dat2->wholistsme.end(), dat);
+ if (it != dat2->wholistsme.end())
// Found me!
- if (*it == dat)
- {
- dat2->wholistsme.erase(it);
- break;
- }
- }
+ dat2->wholistsme.erase(it);
user->WriteServ("NOTICE %s :%s is no longer on your accept list", user->nick.c_str(), whotoremove->nick.c_str());
return true;