From ad36fb43ada8b4b31a10f6a7e1bade9f00aaa661 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 20 Jul 2024 21:05:19 +0200 Subject: libstore: remove addToWeakGoals under owner_less it's equivalent to insert(), only sometimes a little bit faster because it does not construct a weak_ptr if the goal is in the set already. this small difference in performance does not matter here and c++23 will make insert transparent anyway, so we can drop it Change-Id: I7cbd7d6e0daa95d67145ec58183162f6c4743b15 --- src/libstore/build/goal.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/libstore/build/goal.cc') 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()); } -- cgit v1.2.3