Skip to content

Commit 4810718

Browse files
fixup! squash into 1st commit
Co-authored-by: Sergei Zimmerman <[email protected]>
1 parent 5308f10 commit 4810718

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/libutil/include/nix/util/topo-sort.hh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ struct Cycle
1717
template<typename T>
1818
using TopoSortResult = std::variant<std::vector<T>, Cycle<T>>;
1919

20-
template<typename T, typename Compare, typename F>
21-
requires std::invocable<F, const T &>
22-
&& std::same_as<std::remove_cvref_t<std::invoke_result_t<F, const T &>>, std::set<T, Compare>>
20+
template<typename T, typename Compare, std::invocable<const T &> F>
21+
requires std::same_as<std::remove_cvref_t<std::invoke_result_t<F, const T &>>, std::set<T, Compare>>
2322
TopoSortResult<T> topoSort(std::set<T, Compare> items, F && getChildren)
2423
{
2524
std::vector<T> sorted;
@@ -37,7 +36,7 @@ TopoSortResult<T> topoSort(std::set<T, Compare> items, F && getChildren)
3736
}
3837
parents.insert(path);
3938

40-
auto && references = getChildren(path);
39+
auto && references = std::invoke(getChildren, path);
4140

4241
for (auto & i : references)
4342
/* Don't traverse into items that don't exist in our starting set. */

0 commit comments

Comments
 (0)