Merge pull request #59369 from Ekleog/unique-fix

lib: improve the implementation of the unique function
This commit is contained in:
Eelco Dolstra 2019-04-15 14:16:39 +02:00 committed by GitHub
commit 9f5ba91c7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.