diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 11:43:12 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 11:43:12 +0000 |
commit | 1c5e9d246a4990eed062d879276b1844526a04ef (patch) | |
tree | f87579a5d9ef656a755b74058a69e0e8a035d5b0 /src/helperfuncs.cpp | |
parent | 78474291ab99852dc92a43286c67f244c7292a31 (diff) |
Add uuid hash_map - its management is automatic via userrec constructors/destructors.
Note that this means 'fake' users used to set modes etc get a uid, but this isnt a major thing.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7876 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 223099c45..4338fb9da 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -268,17 +268,12 @@ userrec *InspIRCd::FindUUID(const std::string &uid) userrec *InspIRCd::FindUUID(const char *uid) { - for (user_hash::const_iterator a = this->clientlist->begin(); a != this->clientlist->end(); a++) - { - userrec *u = a->second; + user_hash::iterator finduuid = uuidlist->find(uid); - if (strcmp(u->uuid, uid) == 0) - { - return u; - } - } + if (finduuid == uuidlist->end()) + return NULL; - return NULL; + return finduuid->second; } /* find a channel record by channel name and return a pointer to it */ |