Skip to content

Commit e5e0900

Browse files
committed
Work around gcc warning
Same as 57fea81.
1 parent 5756caf commit e5e0900

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/nix-env/nix-env.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,13 @@ static void printMissing(EvalState & state, PackageInfos & elems)
481481
{
482482
std::vector<DerivedPath> targets;
483483
for (auto & i : elems)
484-
if (auto drvPath = i.queryDrvPath())
485-
targets.emplace_back(DerivedPath::Built{
484+
if (auto drvPath = i.queryDrvPath()) {
485+
auto path = DerivedPath::Built{
486486
.drvPath = makeConstantStorePathRef(*drvPath),
487487
.outputs = OutputsSpec::All { },
488-
});
489-
else
488+
};
489+
targets.emplace_back(std::move(path));
490+
} else
490491
targets.emplace_back(DerivedPath::Opaque{
491492
.path = i.queryOutPath(),
492493
});

0 commit comments

Comments
 (0)