summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-21 19:03:13 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-21 19:03:13 +0000
commit163c429ec569cd1a506debb37fbd211332e930ff (patch)
tree417254fe47ffa4f1fc10b7707f13bee7f7460414 /src
parentf0ebde21e57d340c3dca5a3ad0646d4b469bafaa (diff)
Added second form of find() taking const char*, which is faster in the core where char* is used more often
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3273 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/helperfuncs.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 4f9814cda..6e90c023c 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -1024,6 +1024,18 @@ userrec* Find(std::string &nick)
return iter->second;
}
+userrec* Find(const char* nick)
+{
+ if (!nick)
+ return NULL;
+ user_hash::iterator iter = clientlist.find(nick);
+
+ if (iter == clientlist.end())
+ return NULL;
+
+ return iter->second;
+}
+
/* find a channel record by channel name and return a pointer to it */
chanrec* FindChan(const char* chan)