Skip to content
Snippets Groups Projects
Commit 3254681a authored by Ben Boeckel's avatar Ben Boeckel Committed by Ben Boeckel
Browse files

SystemTools: Reserve memory in JoinPath

Change-Id: I50bab3aa8ea1d95dce5220d92aaad90916bf33da
parent e9204f8f
No related branches found
No related tags found
No related merge requests found
...@@ -3563,6 +3563,13 @@ SystemTools ...@@ -3563,6 +3563,13 @@ SystemTools
{ {
// Construct result in a single string. // Construct result in a single string.
kwsys_stl::string result; kwsys_stl::string result;
size_t len = 0;
kwsys_stl::vector<kwsys_stl::string>::const_iterator i;
for(i = first; i != last; ++i)
{
len += 1 + i->size();
}
result.reserve(len);
// The first two components do not add a slash. // The first two components do not add a slash.
if(first != last) if(first != last)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment