Merge pull request #9992 from edolstra/fix-warning

Fix "may be used uninitialized" warning
This commit is contained in:
Eelco Dolstra 2024-02-12 16:02:21 +01:00 committed by GitHub
commit c4ebb82da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -847,7 +847,7 @@ void Store::substitutePaths(const StorePathSet & paths)
if (!willSubstitute.empty())
try {
std::vector<DerivedPath> subs;
for (auto & p : willSubstitute) subs.push_back(DerivedPath::Opaque{p});
for (auto & p : willSubstitute) subs.emplace_back(DerivedPath::Opaque{p});
buildPaths(subs);
} catch (Error & e) {
logWarning(e.info());