diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2021-08-08 01:47:08 +0200 |
---|---|---|
committer | Andreas Rammhold <andreas@rammhold.de> | 2021-08-08 14:05:38 +0200 |
commit | a9cb1ca32c4110aba8d1bb063587ba0badf91f41 (patch) | |
tree | de2f3155937fe2bec6e8a79a7e8214677f41028e /src/libstore/build/goal.hh | |
parent | 2b67cb7b8c8ac7953f7e341d760bdb3c021fe765 (diff) |
libstore: use set instead of list for waiter list
This replaces the O(n) search complexity in our insert code with a
lookup of O(log n). It also makes removing waitees easier as we can use
the extract method provided by the set class.
Diffstat (limited to 'src/libstore/build/goal.hh')
-rw-r--r-- | src/libstore/build/goal.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh index e6bf628cb..192e416d2 100644 --- a/src/libstore/build/goal.hh +++ b/src/libstore/build/goal.hh @@ -19,7 +19,7 @@ struct CompareGoalPtrs { /* Set of goals. */ typedef set<GoalPtr, CompareGoalPtrs> Goals; -typedef list<WeakGoalPtr> WeakGoals; +typedef set<WeakGoalPtr, std::owner_less<WeakGoalPtr>> WeakGoals; /* A map of paths to goals (and the other way around). */ typedef std::map<StorePath, WeakGoalPtr> WeakGoalMap; |