From cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Sep 2012 19:28:16 +0300 Subject: Add const to variables with type size_t. --- src/commandhandler.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/commandhandler.cpp') 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); } -- cgit v1.2.3-60-g2f50