From 53946fe0171cc30259940b2ac83a6e03782b3bf5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 1 Feb 2025 18:33:00 -0500 Subject: [PATCH] Narrow scope on some local variables --- src/libstore/build/derivation-goal.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 4d97250d3..401e2cda1 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -235,12 +235,14 @@ Goal::Co DerivationGoal::haveDerivation() } }); - /* Check what outputs paths are not already valid. */ - auto [allValid, validOutputs] = checkPathValidity(); + { + /* Check what outputs paths are not already valid. */ + auto [allValid, validOutputs] = checkPathValidity(); - /* If they are all valid, then we're done. */ - if (allValid && buildMode == bmNormal) { - co_return done(BuildResult::AlreadyValid, std::move(validOutputs)); + /* If they are all valid, then we're done. */ + if (allValid && buildMode == bmNormal) { + co_return done(BuildResult::AlreadyValid, std::move(validOutputs)); + } } /* We are first going to try to create the invalid output paths