diff options
author | eldritch horrors <pennae@lix.systems> | 2024-10-05 00:38:35 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-10-05 21:19:51 +0000 |
commit | 649d8cd08fa16c71e3580f16d77c2122540f3195 (patch) | |
tree | a904bff8c6fee45e08cb7154c9b6befaa964f525 /src/libstore/build/worker.hh | |
parent | 9adf6f4568d5a6b1c61ff93beb12a45b962c2602 (diff) |
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
Diffstat (limited to 'src/libstore/build/worker.hh')
-rw-r--r-- | src/libstore/build/worker.hh | 7 |
1 files changed, 1 insertions, 6 deletions
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<typename G> struct CachedGoal { - std::weak_ptr<G> goal; + std::shared_ptr<G> goal; kj::ForkedPromise<Result<Goal::WorkResult>> promise{nullptr}; }; /** @@ -135,11 +135,6 @@ private: void goalFinished(GoalPtr goal, Goal::WorkResult & f); /** - * Remove a dead goal. - */ - void removeGoal(GoalPtr goal); - - /** * Registers a running child process. */ void childStarted(GoalPtr goal, kj::Promise<Result<Goal::WorkResult>> promise); |