]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Removed a pointless check in ./configure --clean that made it only work with one...
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index e9ae9168e4c391f2fd0abdaca2cc895a7d4cbb5d..dab21744aafaf1780f0751cd03b9584903156dd9 100644 (file)
@@ -76,7 +76,7 @@ void InspIRCd::Log(int level, const std::string &text)
 
 std::string InspIRCd::GetServerDescription(const char* servername)
 {
-       std::string description = "";
+       std::string description;
 
        FOREACH_MOD_I(this,I_OnGetServerDescription,OnGetServerDescription(servername,description));
 
@@ -238,12 +238,7 @@ userrec* InspIRCd::FindNick(const std::string &nick)
 
 userrec* InspIRCd::FindNick(const char* nick)
 {
-       user_hash::iterator iter;
-
-       if (!nick)
-               return NULL;
-
-       iter = clientlist.find(nick);
+       user_hash::iterator iter = clientlist.find(nick);
        
        if (iter == clientlist.end())
                return NULL;
@@ -255,12 +250,7 @@ userrec* InspIRCd::FindNick(const char* nick)
 
 chanrec* InspIRCd::FindChan(const char* chan)
 {
-       chan_hash::iterator iter;
-
-       if (!chan)
-               return NULL;
-
-       iter = chanlist.find(chan);
+       chan_hash::iterator iter = chanlist.find(chan);
 
        if (iter == chanlist.end())
                /* Couldn't find it */
@@ -280,7 +270,6 @@ chanrec* InspIRCd::FindChan(const std::string &chan)
        return iter->second;
 }
 
-
 /*
  * sends out an error notice to all connected clients (not to be used
  * lightly!)
@@ -311,14 +300,7 @@ int InspIRCd::UserCount()
 // this counts only registered users, so that the percentages in /MAP don't mess up when users are sitting in an unregistered state
 int InspIRCd::RegisteredUserCount()
 {
-       int c = 0;
-
-       for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
-       {
-               c += (i->second->registered == REG_ALL);
-       }
-
-       return c;
+       return clientlist.size() - this->UnregisteredUserCount();
 }
 
 int InspIRCd::InvisibleUserCount()