summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-26 01:40:00 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-26 01:40:00 +0300
commitd4febba47388979b26cd4680cb8a6f20e548e399 (patch)
tree2d520db672ed39b755e668828d27f0dd9d18ed6e /src/utils/stringutils.cpp
parent803b6afd00b0e3574b40b866f21a0d3d01f6dc4d (diff)
downloadmanaplus-d4febba47388979b26cd4680cb8a6f20e548e399.tar.gz
manaplus-d4febba47388979b26cd4680cb8a6f20e548e399.tar.bz2
manaplus-d4febba47388979b26cd4680cb8a6f20e548e399.tar.xz
manaplus-d4febba47388979b26cd4680cb8a6f20e548e399.zip
Improve string usage in other files.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index d4585a26d..3378ec132 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -494,8 +494,8 @@ std::string combineDye(std::string file, std::string dye)
return file;
const size_t pos = file.find_last_of("|");
if (pos != std::string::npos)
- return file.substr(0, pos) + "|" + dye;
- return file + "|" + dye;
+ return file.substr(0, pos).append("|").append(dye);
+ return file.append("|").append(dye);
}
std::string combineDye2(std::string file, std::string dye)
@@ -515,9 +515,9 @@ std::string combineDye2(std::string file, std::string dye)
it2 = list2.begin(), it1_end = list1.end(), it2_end = list2.end();
it1 != it1_end && it2 != it2_end; ++it1, ++it2)
{
- str += (*it1) + ":" + (*it2) + ";";
+ str.append(*it1).append(":").append(*it2).append(";");
}
- return file + "|" + str;
+ return file.append("|").append(str);
}
else
{
@@ -531,7 +531,7 @@ std::string packList(const std::list<std::string> &list)
std::string str("");
while (i != list.end())
{
- str = str + (*i) + "|";
+ str.append(*i).append("|");
++ i;
}
if (str.size() > 1)
@@ -551,7 +551,7 @@ std::string stringToHexPath(const std::string &str)
std::string hex = strprintf("%%%2x/", static_cast<int>(str[0]));
for (unsigned f = 1, sz = static_cast<unsigned>(str.size()); f < sz; f ++)
- hex += strprintf("%%%2x", static_cast<int>(str[f]));
+ hex.append(strprintf("%%%2x", static_cast<int>(str[f])));
return hex;
}