1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 00:51:47 +02:00

Merge pull request #11847 from xokdvium/dev/some-vector-reserves

refactor(treewide): reserve vector capacity when final size is known
This commit is contained in:
Jörg Thalheim 2024-11-09 21:49:36 +01:00 committed by GitHub
commit cdcf9bd2fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 6 additions and 0 deletions

View file

@ -56,6 +56,7 @@ ExecutablePath ExecutablePath::parse(const OsString & path)
OsString ExecutablePath::render() const
{
std::vector<PathViewNG> path2;
path2.reserve(directories.size());
for (auto & p : directories)
path2.push_back(p.native());
return basicConcatStringsSep(path_var_separator, path2);