From 59427ca7f163c39acab3853f22ab23cc11b92606 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 18 Dec 2006 18:42:17 +0000 Subject: std::string something = ""; is the most redundant and wasteful thing in the world, apart from unrealircd. BE GONE WITH IT! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6046 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 842a6a4ca..dab21744a 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -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!) -- cgit v1.2.3