diff --git a/src/util.cc b/src/util.cc index 5c8fe05013..1c73b4e89f 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1557,11 +1557,13 @@ string normalize_path(const std::string_view path) size_t n; vector components, final_components; string new_path; + new_path.reserve(path.size()); if ( !path.empty() && path[0] == '/' ) new_path = "/"; tokenize_string(path, "/", &components); + final_components.reserve(components.size()); vector::const_iterator it; for ( it = components.begin(); it != components.end(); ++it )