]> git.tdb.fi Git - builder.git/commitdiff
Remove redundant task setup from Copy
authorMikko Rasa <tdb@tdb.fi>
Thu, 22 Dec 2022 14:22:22 +0000 (16:22 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 22 Dec 2022 14:41:47 +0000 (16:41 +0200)
FileTarget already does this

source/copy.cpp

index 31e62100d9751d991a0bf59529dd7699973e8ac5..9bca33f3050989900407937c3fd68bb0536f76c6 100644 (file)
@@ -26,10 +26,7 @@ Target *Copy::create_target(const vector<Target *> &sources, const string &arg)
 Task *Copy::run(const Target &target) const
 {
        const InstalledFile &install = dynamic_cast<const InstalledFile &>(target);
-       InternalTask *task = new InternalTask([&install]{ return _run(install); });
-       task->add_file(install.get_path());
-       task->set_unlink();
-       return task;
+       return new InternalTask([&install]{ return _run(install); });
 }
 
 bool Copy::_run(const InstalledFile &install)