From d4febba47388979b26cd4680cb8a6f20e548e399 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Feb 2013 01:40:00 +0300 Subject: Improve string usage in other files. --- src/utils/stringutils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/utils/stringutils.cpp') 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 &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(str[0])); for (unsigned f = 1, sz = static_cast(str.size()); f < sz; f ++) - hex += strprintf("%%%2x", static_cast(str[f])); + hex.append(strprintf("%%%2x", static_cast(str[f]))); return hex; } -- cgit v1.2.3-60-g2f50