diff --git a/src/libstore/build/goal.cc b/src/libstore/build/goal.cc index 2704fc6ab..8f190cede 100644 --- a/src/libstore/build/goal.cc +++ b/src/libstore/build/goal.cc @@ -34,18 +34,10 @@ BuildResult Goal::getBuildResult(const DerivedPath & req) const { } -void addToWeakGoals(WeakGoals & goals, GoalPtr p) -{ - if (goals.find(p) != goals.end()) - return; - goals.insert(p); -} - - void Goal::addWaitee(GoalPtr waitee) { waitees.insert(waitee); - addToWeakGoals(waitee->waiters, shared_from_this()); + waitee->waiters.insert(shared_from_this()); } diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh index 058c8add8..930fe90da 100644 --- a/src/libstore/build/goal.hh +++ b/src/libstore/build/goal.hh @@ -175,6 +175,4 @@ public: virtual JobCategory jobCategory() const = 0; }; -void addToWeakGoals(WeakGoals & goals, GoalPtr p); - } diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index f1f024ff6..873993e0d 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -163,7 +163,7 @@ void Worker::removeGoal(GoalPtr goal) void Worker::wakeUp(GoalPtr goal) { goal->trace("woken up"); - addToWeakGoals(awake, goal); + awake.insert(goal); } @@ -249,14 +249,14 @@ void Worker::waitForBuildSlot(GoalPtr goal) (isSubstitutionGoal && getNrSubstitutions() < settings.maxSubstitutionJobs)) wakeUp(goal); /* we can do it right away */ else - addToWeakGoals(wantingToBuild, goal); + wantingToBuild.insert(goal); } void Worker::waitForAWhile(GoalPtr goal) { debug("wait for a while"); - addToWeakGoals(waitingForAWhile, goal); + waitingForAWhile.insert(goal); }