summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-08 00:07:56 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-08 00:07:56 +0300
commitb3f70d8d46199524edc590269a73c262899763c7 (patch)
treeaf8e20371f2cc825c0b2dbe0c0e5c392a926c46d /src/utils
parent3f84fc198131ff706e18c56f612e38ff147b0005 (diff)
downloadmanaplus-b3f70d8d46199524edc590269a73c262899763c7.tar.gz
manaplus-b3f70d8d46199524edc590269a73c262899763c7.tar.bz2
manaplus-b3f70d8d46199524edc590269a73c262899763c7.tar.xz
manaplus-b3f70d8d46199524edc590269a73c262899763c7.zip
Replace most iterator to const_iterator.
Some other minor changes.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 176c5499c..f3aed5276 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -185,10 +185,11 @@ unsigned long findI(std::string text, std::vector<std::string> &list)
{
std::string str = toLower(text);
unsigned long idx;
- for (std::vector<std::string>::iterator i = list.begin();
+ for (std::vector<std::string>::const_iterator i = list.begin();
i != list.end(); ++i)
{
- std::string subStr = toLower(*i);
+ std::string subStr = *i;
+ subStr = toLower(subStr);
idx = str.find(subStr);
if (idx != std::string::npos)
return idx;
@@ -450,8 +451,8 @@ std::string combineDye2(std::string file, std::string dye)
file = file.substr(0, pos);
std::list<std::string> list1 = splitToStringList(dye1, ';');
std::list<std::string> list2 = splitToStringList(dye, ';');
- std::list<std::string>::iterator it1, it1_end = list1.end();
- std::list<std::string>::iterator it2, it2_end = list2.end();
+ std::list<std::string>::const_iterator it1, it1_end = list1.end();
+ std::list<std::string>::const_iterator it2, it2_end = list2.end();
for (it1 = list1.begin(), it2 = list2.begin();
it1 != it1_end && it2 != it2_end; ++it1, ++it2)
{
@@ -485,7 +486,7 @@ std::vector<std::string> getLang()
std::string packList(std::list<std::string> &list)
{
- std::list<std::string>::iterator i = list.begin();
+ std::list<std::string>::const_iterator i = list.begin();
std::string str = "";
while (i != list.end())
{