summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.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/gui/chatwindow.cpp
parentf8fc3380197c078a6dcff02351d835c3022411e1 (diff)
downloadmv-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.gz
mv-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.bz2
mv-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.tar.xz
mv-cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96.zip
Add const to variables with type size_t.
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r--src/gui/chatwindow.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 9ea0bb383..fdc6169ed 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -1055,7 +1055,7 @@ void ChatWindow::addWhisper(const std::string &nick,
{
std::string msg = mes;
std::string nick2;
- size_t idx = mes.find(":");
+ const size_t idx = mes.find(":");
if (idx != std::string::npos && idx > 0)
{
nick2 = msg.substr(0, idx);
@@ -1298,7 +1298,7 @@ std::string ChatWindow::autoComplete(StringVect &names,
std::string name = *i;
toLower(name);
- size_t pos = name.find(partName, 0);
+ const size_t pos = name.find(partName, 0);
if (pos == 0)
{
if (newName != "")
@@ -1330,8 +1330,7 @@ std::string ChatWindow::autoComplete(std::string partName,
while (i != i_end)
{
std::string line = *i;
- size_t pos = line.find(partName, 0);
- if (pos == 0)
+ if (line.find(partName, 0) == 0)
nameList.push_back(line);
++i;
}
@@ -1388,7 +1387,7 @@ void ChatWindow::resortChatLog(std::string line, Own own,
return;
}
- size_t idx = line.find(": \302\202");
+ const size_t idx = line.find(": \302\202");
if (idx != std::string::npos)
{
line = line.erase(idx + 2, 2);
@@ -1396,13 +1395,13 @@ void ChatWindow::resortChatLog(std::string line, Own own,
return;
}
- size_t idx1 = line.find("@@");
+ const size_t idx1 = line.find("@@");
if (idx1 != std::string::npos)
{
- size_t idx2 = line.find("|", idx1);
+ const size_t idx2 = line.find("|", idx1);
if (idx2 != std::string::npos)
{
- size_t idx3 = line.find("@@", idx2);
+ const size_t idx3 = line.find("@@", idx2);
if (idx3 != std::string::npos)
{
if (line.find("http", idx1) != idx1 + 2)