From 8f55577ce329ec6351a1962b71f9a4fbe76a3f22 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 21 Nov 2012 05:04:37 +0100 Subject: Simplify UserManager::AddLocalClone()/AddGlobalClone() --- src/usermanager.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/usermanager.cpp') diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 3742c855d..bb4d58d90 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -243,23 +243,12 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char void UserManager::AddLocalClone(User *user) { - clonemap::iterator x; - x = local_clones.find(user->GetCIDRMask()); - if (x != local_clones.end()) - x->second++; - else - local_clones[user->GetCIDRMask()] = 1; + local_clones[user->GetCIDRMask()]++; } void UserManager::AddGlobalClone(User *user) { - clonemap::iterator x; - - x = global_clones.find(user->GetCIDRMask()); - if (x != global_clones.end()) - x->second++; - else - global_clones[user->GetCIDRMask()] = 1; + global_clones[user->GetCIDRMask()]++; } void UserManager::RemoveCloneCounts(User *user) -- cgit v1.2.3