summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-16 19:28:16 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-16 19:28:16 +0300
commitcd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96 (patch)
treefdda7e2c3d93b35771f6eb79c22dce9301082f19 /src/commandhandler.cpp
parentf8fc3380197c078a6dcff02351d835c3022411e1 (diff)
downloadManaVerse-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.gz
ManaVerse-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.bz2
ManaVerse-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.xz
ManaVerse-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.zip
Add const to variables with type size_t.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index bdce12dea..6140b398e 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -88,11 +88,10 @@ void CommandHandler::handleCommands(const std::string &command,
void CommandHandler::handleCommand(const std::string &command,
ChatTab *const tab)
{
- size_t pos = command.find(' ');
- std::string type(command, 0, pos);
+ const size_t pos = command.find(' ');
+ const std::string type(command, 0, pos);
std::string args(command, pos == std::string::npos
? command.size() : pos + 1);
-
args = trim(args);
if (command == "closeall")
@@ -377,9 +376,9 @@ void CommandHandler::handleJoin(const std::string &args, ChatTab *const tab)
if (!tab)
return;
- size_t pos = args.find(' ');
- std::string name(args, 0, pos);
- std::string password(args, pos + 1);
+ const size_t pos = args.find(' ');
+ const std::string name(args, 0, pos);
+ const std::string password(args, pos + 1);
tab->chatLog(strprintf(_("Requesting to join channel %s."), name.c_str()));
Net::getChatHandler()->enterChannel(name, password);
}