Skip to content

Commit

Permalink
Remove unnecessary conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Sep 16, 2020
1 parent 36d973f commit bef138c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/libstore/daemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,15 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
}

logger->startWork();
std::optional<StorePath> path;
{
// Destructor of FramedSource must run before stopWork.
StorePath path = [&](){
FramedSource narSource(from);
path = store->addToStoreFromDump(narSource, baseName, method, hashAlgo);
}
return store->addToStoreFromDump(narSource, baseName, method, hashAlgo);
}();
logger->stopWork();

if (path /* always */) {
to << store->printStorePath(*path);
}
to << store->printStorePath(path);

break;
}

Expand Down

0 comments on commit bef138c

Please sign in to comment.