1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 15:31: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

@ -91,6 +91,7 @@ StringMap EvalState::realiseContext(const NixStringContext & context, StorePathS
/* Build/substitute the context. */
std::vector<DerivedPath> buildReqs;
buildReqs.reserve(drvs.size());
for (auto & d : drvs) buildReqs.emplace_back(DerivedPath { d });
buildStore->buildPaths(buildReqs, bmNormal, store);