# # # patch "paths.cc" # from [5a81214a6d8ce81c997052ff7d17df925320a777] # to [6d7a9369af3c2a54c001d8199c7133a64ce78193] # ============================================================ --- paths.cc 5a81214a6d8ce81c997052ff7d17df925320a777 +++ paths.cc 6d7a9369af3c2a54c001d8199c7133a64ce78193 @@ -9,7 +9,6 @@ #include "base.hh" #include -#include #include "paths.hh" #include "file_io.hh" @@ -311,6 +310,7 @@ normalize_path(string const & in) vector stack; string::const_iterator head, tail; + string::size_type size_estimate = leader.size(); for (head = inT.begin(); head != inT.end(); head = tail) { tail = head; @@ -330,10 +330,18 @@ normalize_path(string const & in) continue; } + size_estimate += elt.size() + 1; stack.push_back(elt); } - return leader + boost::algorithm::join(stack, "/"); + leader.reserve(size_estimate); + for (vector::const_iterator i = stack.begin(); i != stack.end(); i++) + { + if (i != stack.begin()) + leader += "/"; + leader += *i; + } + return leader; } static void