diff --git a/lib/lists.nix b/lib/lists.nix index 75cdf3cbf499..9863c064426d 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -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