From f98da2e00b59b9f124002251e7f1b452402c512a Mon Sep 17 00:00:00 2001 From: John Soo Date: Thu, 21 Apr 2022 11:25:40 -0700 Subject: [PATCH] Cleanup worker json handling. --- src/nix-eval-jobs.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/nix-eval-jobs.cc b/src/nix-eval-jobs.cc index 3f43d84..3031c69 100644 --- a/src/nix-eval-jobs.cc +++ b/src/nix-eval-jobs.cc @@ -252,9 +252,7 @@ static void worker( debug("worker process %d at '%s'", getpid(), attrPath); /* Evaluate it and send info back to the collector. */ - nlohmann::json reply; - reply["attr"] = attrPath; - + nlohmann::json reply = nlohmann::json{ { "attr", attrPath } }; try { auto vTmp = findAlongAttrPath(state, attrPath, autoArgs, *vRoot).first; @@ -264,9 +262,7 @@ static void worker( if (auto drvInfo = getDerivation(state, *v, false)) { auto drv = Drv(state, *drvInfo); - - reply = drv; - reply["attr"] = attrPath; + reply.update(drv); /* Register the derivation as a GC root. !!! This registers roots for jobs that we may have already