mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-12 20:19:02 -04:00
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
This commit is contained in:
parent
f0ebde21e5
commit
163c429ec5
@ -61,6 +61,7 @@ void ServerPrivmsgAll(char* text, ...);
|
||||
void WriteWallOps(userrec *source, bool local_only, char* text, ...);
|
||||
void strlower(char *n);
|
||||
userrec* Find(std::string &nick);
|
||||
userrec* Find(const char* nick);
|
||||
chanrec* FindChan(const char* chan);
|
||||
long GetMaxBans(char* name);
|
||||
void purge_empty_chans(userrec* u);
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user