From 2f46ba7b214e4841f09c263557a0f33113513eb9 Mon Sep 17 00:00:00 2001 From: Asher Glick Date: Sat, 4 Nov 2023 02:01:42 -0500 Subject: [PATCH] Using the correct preallocation method for the join function The previous one caused some errors with null characters being added to the output string which would show up on the written xml diff. --- xml_converter/src/string_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml_converter/src/string_helper.cpp b/xml_converter/src/string_helper.cpp index 39e62710..62d44d8c 100644 --- a/xml_converter/src/string_helper.cpp +++ b/xml_converter/src/string_helper.cpp @@ -55,7 +55,7 @@ string join(const vector& 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];