From 76245ffbebc8466ac17d241fceda6dcb9ec7c23e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 6 Jul 2024 20:55:27 +0200 Subject: [PATCH] nix-build.cc: Refactor: extract sourcePath, resolvedPath variables --- src/nix-build/nix-build.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index 648917444..e873f712b 100644 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -315,11 +315,11 @@ static void main_nix_build(int argc, char * * argv) relative to the script. */ auto baseDir = inShebang && !packages ? absPath(i, absPath(dirOf(script))) : i; - exprs.push_back( - state->parseExprFromFile( - resolveExprPath( - lookupFileArg(*state, - baseDir)))); + auto sourcePath = lookupFileArg(*state, + baseDir); + auto resolvedPath = resolveExprPath(sourcePath); + + exprs.push_back(state->parseExprFromFile(resolvedPath)); } } }