From 8319ead5947bb0df46e8e5b706e39676881db5e4 Mon Sep 17 00:00:00 2001 From: Léo Gaspard Date: Fri, 12 Apr 2019 20:08:29 +0200 Subject: lib: improve the implementation of the unique function --- lib/lists.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/lists.nix b/lib/lists.nix index 9f2ccc00caf..30d87ece664 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -633,8 +633,7 @@ rec { else let x = head list; - xs = unique (drop 1 list); - in [x] ++ remove x xs; + in [x] ++ unique (remove x list); /* Intersects list 'e' and another list. O(nm) complexity. -- cgit 1.4.1