aboutsummaryrefslogtreecommitdiffstats
path: root/src/users.cpp
diff options
context:
space:
mode:
authorGravatar Daniel De Graaf2010-02-26 11:49:35 -0600
committerGravatar Daniel De Graaf2010-08-03 17:32:38 -0400
commitb7796da64ce04b8894acdf316b92be6b26b019dd (patch)
treef9fe2c86d9e7f493cb4455a2fcd74ec30ebf420f /src/users.cpp
parentMove hex-mixup code from to m_md5 to m_cloaking (diff)
Remove three rarely-used cache items
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp37
1 files changed, 6 insertions, 31 deletions
diff --git a/src/users.cpp b/src/users.cpp
index f08c94d75..d32eecb7a 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -219,11 +219,8 @@ User::~User()
ServerInstance->Logs->Log("USERS", DEFAULT, "User destructor for %s called without cull", uuid.c_str());
}
-const std::string& User::MakeHost()
+std::string User::MakeHost()
{
- if (!this->cached_makehost.empty())
- return this->cached_makehost;
-
char nhost[MAXBUF];
/* This is much faster than snprintf */
char* t = nhost;
@@ -234,16 +231,11 @@ const std::string& User::MakeHost()
*t++ = *n;
*t = 0;
- this->cached_makehost.assign(nhost);
-
- return this->cached_makehost;
+ return nhost;
}
-const std::string& User::MakeHostIP()
+std::string User::MakeHostIP()
{
- if (!this->cached_hostip.empty())
- return this->cached_hostip;
-
char ihost[MAXBUF];
/* This is much faster than snprintf */
char* t = ihost;
@@ -254,9 +246,7 @@ const std::string& User::MakeHostIP()
*t++ = *n;
*t = 0;
- this->cached_hostip = ihost;
-
- return this->cached_hostip;
+ return ihost;
}
const std::string& User::GetFullHost()
@@ -293,11 +283,8 @@ char* User::MakeWildHost()
return nresult;
}
-const std::string& User::GetFullRealHost()
+std::string User::GetFullRealHost()
{
- if (!this->cached_fullrealhost.empty())
- return this->cached_fullrealhost;
-
char fresult[MAXBUF];
char* t = fresult;
for(const char* n = nick.c_str(); *n; n++)
@@ -310,9 +297,7 @@ const std::string& User::GetFullRealHost()
*t++ = *n;
*t = 0;
- this->cached_fullrealhost = fresult;
-
- return this->cached_fullrealhost;
+ return fresult;
}
bool LocalUser::IsInvited(const irc::string &channel)
@@ -836,9 +821,6 @@ void User::InvalidateCache()
{
/* Invalidate cache */
cached_fullhost.clear();
- cached_hostip.clear();
- cached_makehost.clear();
- cached_fullrealhost.clear();
}
bool User::ChangeNick(const std::string& newnick, bool force)
@@ -1678,13 +1660,6 @@ const std::string& FakeUser::GetFullHost()
return server;
}
-const std::string& FakeUser::GetFullRealHost()
-{
- if (!ServerInstance->Config->HideWhoisServer.empty())
- return ServerInstance->Config->HideWhoisServer;
- return server;
-}
-
ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask)
: config(tag), type(t), fakelag(true), name("unnamed"), registration_timeout(0), host(mask),
pingtime(0), softsendqmax(0), hardsendqmax(0), recvqmax(0),