fix(string_util): Join vector of strings

This commit is contained in:
Michael Carlberg
2016-11-27 01:32:21 +01:00
parent 4852f2817c
commit 6f6c5b7459
2 changed files with 3 additions and 3 deletions

View File

@ -164,10 +164,10 @@ namespace string_util {
/**
* Join all strings in vector into a single string separated by delim
*/
string join(vector<string> strs, string delim) {
string join(const vector<string>& strs, const string& delim) {
string str;
for (auto& s : strs) {
str.append((str.empty() ? "" : move(delim)) + s);
str += (str.empty() ? "" : delim) + s;
}
return str;
}