Commit 1bfede12 authored by Max Kellermann's avatar Max Kellermann

fs/Traits: call std::string::reserve() in BuildPathImpl()

parent e9685603
......@@ -35,7 +35,10 @@ BuildPathImpl(typename Traits::const_pointer_type a, size_t a_size,
if (b_size == 0)
return typename Traits::string(a, a_size);
typename Traits::string result(a, a_size);
typename Traits::string result;
result.reserve(a_size + 1 + b_size);
result.append(a, a_size);
if (!Traits::IsSeparator(a[a_size - 1]))
result.push_back(Traits::SEPARATOR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment