Remove redundant Finally

This commit is contained in:
Eelco Dolstra 2022-08-24 14:49:58 +02:00
parent 8d906b1f3b
commit 56d97d4b4d

View file

@ -11,7 +11,6 @@
#include "archive.hh" #include "archive.hh"
#include "callback.hh" #include "callback.hh"
#include "remote-store.hh" #include "remote-store.hh"
#include "finally.hh"
#include <regex> #include <regex>
@ -309,7 +308,6 @@ void Store::addMultipleToStore(
auto & [info_, source_] = *infosMap.at(path); auto & [info_, source_] = *infosMap.at(path);
auto info = info_; auto info = info_;
auto source = std::move(source_);
info.ultimate = false; info.ultimate = false;
/* Make sure that the Source object is destroyed when /* Make sure that the Source object is destroyed when
@ -317,9 +315,7 @@ void Store::addMultipleToStore(
be destroyed to ensure that the destructors on its be destroyed to ensure that the destructors on its
stack frame are run; this includes stack frame are run; this includes
LegacySSHStore::narFromPath()'s connection lock. */ LegacySSHStore::narFromPath()'s connection lock. */
Finally cleanupSource{[&]() { auto source = std::move(source_);
source.reset();
}};
if (!isValidPath(info.path)) { if (!isValidPath(info.path)) {
MaintainCount<decltype(nrRunning)> mc(nrRunning); MaintainCount<decltype(nrRunning)> mc(nrRunning);