Skip to content

Commit

Permalink
Merge pull request #200 from AsherGlick/stringhelper_join_fix
Browse files Browse the repository at this point in the history
Using the correct preallocation method for the join function
  • Loading branch information
AsherGlick authored Nov 5, 2023
2 parents 8d07653 + 2f46ba7 commit 6ed5315
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xml_converter/src/string_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ string join(const vector<string>& input, const string& delimiter) {
size += input[i].size() + delimiter.size();
}

result.resize(size);
result.reserve(size);

for (size_t i = 0; i < input.size(); i++) {
result += input[i];
Expand Down

0 comments on commit 6ed5315

Please sign in to comment.