lib.lists.toposort: avoid reversing element causing a cycle

This commit is contained in:
Eman Resu
2026-06-24 18:29:22 -04:00
parent 7d2f66c0ad
commit 4e2f331f87
+1 -1
View File
@@ -1262,7 +1262,7 @@ rec {
else if dfsthis ? cycle then
# there's a cycle, starting from the current vertex, return it
{
cycle = reverseList ([ dfsthis.cycle ] ++ dfsthis.visited);
cycle = reverseList dfsthis.visited ++ [ dfsthis.cycle ];
inherit (dfsthis) loops;
}
else if toporest ? cycle then