From 1c5e9d246a4990eed062d879276b1844526a04ef Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 27 Aug 2007 11:43:12 +0000 Subject: 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 --- src/helperfuncs.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/helperfuncs.cpp') 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 */ -- cgit v1.3.1-10-gc9f91