diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-11-01 18:17:04 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-11-01 18:17:04 +0100 |
commit | fbc73e20784b055485f676096e758d6aeed62e0c (patch) | |
tree | 8251c8473af414527becb989558a69c4e7dc49b4 /src/xline.cpp | |
parent | 5fb509060fa7552a25efccad11595898d420d476 (diff) |
Add stdalgo::erase() and use it to simplify code
Diffstat (limited to 'src/xline.cpp')
-rw-r--r-- | src/xline.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 3eb556234..13124a392 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -312,9 +312,7 @@ bool XLineManager::DelLine(const char* hostmask, const std::string &type, User* y->second->Unset(); - std::vector<XLine*>::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), y->second); - if (pptr != pending_lines.end()) - pending_lines.erase(pptr); + stdalgo::erase(pending_lines, y->second); delete y->second; x->second.erase(y); @@ -419,9 +417,7 @@ void XLineManager::ExpireLine(ContainerIter container, LookupIter item) * is pending, cleared when it is no longer pending, so we skip over this loop if its not pending? * -- Brain */ - std::vector<XLine*>::iterator pptr = std::find(pending_lines.begin(), pending_lines.end(), item->second); - if (pptr != pending_lines.end()) - pending_lines.erase(pptr); + stdalgo::erase(pending_lines, item->second); delete item->second; container->second.erase(item); |