summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-04-15 14:16:39 +0200
committerGitHub <noreply@github.com>2019-04-15 14:16:39 +0200
commit9f5ba91c7a9750483206b0df4d0b0fc1d903c88a (patch)
tree9a2c2466701a51025fb6342f83abaa58ba2ca4a3 /lib
parent4e3b5a07537fba5ff7ef9c82b8189a0f0be4bde5 (diff)
parent8319ead5947bb0df46e8e5b706e39676881db5e4 (diff)
downloadnixpkgs-9f5ba91c7a9750483206b0df4d0b0fc1d903c88a.tar
nixpkgs-9f5ba91c7a9750483206b0df4d0b0fc1d903c88a.tar.gz
nixpkgs-9f5ba91c7a9750483206b0df4d0b0fc1d903c88a.tar.bz2
nixpkgs-9f5ba91c7a9750483206b0df4d0b0fc1d903c88a.tar.lz
nixpkgs-9f5ba91c7a9750483206b0df4d0b0fc1d903c88a.tar.xz
nixpkgs-9f5ba91c7a9750483206b0df4d0b0fc1d903c88a.tar.zst
nixpkgs-9f5ba91c7a9750483206b0df4d0b0fc1d903c88a.zip
Merge pull request #59369 from Ekleog/unique-fix
lib: improve the implementation of the unique function
Diffstat (limited to 'lib')
-rw-r--r--lib/lists.nix3
1 files changed, 1 insertions, 2 deletions
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.