From 649d8cd08fa16c71e3580f16d77c2122540f3195 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 5 Oct 2024 00:38:35 +0200 Subject: libstore: remove Worker::removeGoal we can use our newfound powers of Goal::work Is A Real Promise to remove completed goals from continuation promises. apart from being much easier to follow it's also a lot more efficient because we have the iterator to the item we are trying to remove, skipping a linear search of the cache. Change-Id: Ie0190d051c5f4b81304d98db478348b20c209df5 --- src/libstore/build/worker.hh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/libstore/build/worker.hh') diff --git a/src/libstore/build/worker.hh b/src/libstore/build/worker.hh index 923092b51..fcf0ad8c7 100644 --- a/src/libstore/build/worker.hh +++ b/src/libstore/build/worker.hh @@ -95,7 +95,7 @@ private: template struct CachedGoal { - std::weak_ptr goal; + std::shared_ptr goal; kj::ForkedPromise> promise{nullptr}; }; /** @@ -134,11 +134,6 @@ private: void goalFinished(GoalPtr goal, Goal::WorkResult & f); - /** - * Remove a dead goal. - */ - void removeGoal(GoalPtr goal); - /** * Registers a running child process. */ -- cgit v1.2.3