summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-14 16:42:22 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-14 16:42:22 +0200
commite7bdcd71dce911f64d8f0c85f4935dfa83a81dd3 (patch)
tree5f4bd070fb85ab99b15133f897a0817b3fdd2d03 /src/server.cpp
parent831998ff16f28d0ab58c01aa2c47be488bf78b82 (diff)
Minor ISupportManager changes
- Make GetLines() a const method - Rename Lines to cachedlines - Get rid of a variable in Build()
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 66466fae9..ceefa4387 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -198,10 +198,9 @@ void ISupportManager::Build()
}
// Transform the map into a list of lines, ready to be sent to clients
- std::vector<std::string>& lines = this->Lines;
std::string line;
unsigned int token_count = 0;
- lines.clear();
+ cachedlines.clear();
for (std::map<std::string, std::string>::const_iterator it = tokens.begin(); it != tokens.end(); ++it)
{
@@ -220,7 +219,7 @@ void ISupportManager::Build()
// Reached maximum number of tokens for this line or the current token
// is the last one; finalize the line and store it for later use
line.append(":are supported by this server");
- lines.push_back(line);
+ cachedlines.push_back(line);
line.clear();
}
}
@@ -228,6 +227,6 @@ void ISupportManager::Build()
void ISupportManager::SendTo(LocalUser* user)
{
- for (std::vector<std::string>::const_iterator i = this->Lines.begin(); i != this->Lines.end(); ++i)
+ for (std::vector<std::string>::const_iterator i = cachedlines.begin(); i != cachedlines.end(); ++i)
user->WriteNumeric(RPL_ISUPPORT, *i);
}