diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-11-21 05:04:37 +0100 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-11-24 03:58:48 +0100 |
commit | 8f55577ce329ec6351a1962b71f9a4fbe76a3f22 (patch) | |
tree | 37b96622183f40816e666598f5f58d072816c61c | |
parent | 66267bab3ecc47f6d15fac1c0bc770ac28d83d5f (diff) |
Simplify UserManager::AddLocalClone()/AddGlobalClone()
-rw-r--r-- | src/usermanager.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
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) |