From 8199f4dd3e64450d464c0ac97b34d90c165df066 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 1 Jul 2007 12:06:15 +0000 Subject: Optimizations and code tidyups. QA please check that svsnick and other forced nick changes still work right after this git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7416 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 5bfc9a46b..bc221b263 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -198,7 +198,7 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl, else if ((this->fwd) && (ServerInstance->SE->GetRef(this->bound_fd) == this->bound_user)) { /* Both lookups completed */ - std::string result2 = "0::ffff:"; + std::string result2("0::ffff:"); result2.append(result); if (this->bound_user->GetIPString() == result || this->bound_user->GetIPString() == result2) { @@ -210,7 +210,7 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl, { /* Hostnames starting with : are not a good thing (tm) */ if (*(hostname.c_str()) == ':') - hostname = "0" + hostname; + hostname.insert(0, "0"); this->bound_user->WriteServ("NOTICE Auth :*** Found your hostname (%s)%s", hostname.c_str(), (cached ? " -- cached" : "")); this->bound_user->dns_done = true; @@ -1181,10 +1181,7 @@ bool userrec::ForceNickChange(const char* newnick) if (this->registered == REG_ALL) { - const char* pars[1]; - pars[0] = newnick; - std::string cmd = "NICK"; - return (ServerInstance->Parser->CallHandler(cmd, pars, 1, this) == CMD_SUCCESS); + return (ServerInstance->Parser->CallHandler("NICK", &newnick, 1, this) == CMD_SUCCESS); } return false; } @@ -1620,7 +1617,8 @@ void userrec::WriteWallOps(const std::string &text) if (!IS_OPER(this) && IS_LOCAL(this)) return; - std::string wallop = "WALLOPS :" + text; + std::string wallop("WALLOPS :"); + wallop.append(text); for (std::vector::const_iterator i = ServerInstance->local_users.begin(); i != ServerInstance->local_users.end(); i++) { -- cgit v1.3.1-10-gc9f91