Merge pull request #59369 from Ekleog/unique-fix
lib: improve the implementation of the unique function
This commit is contained in:
commit
9f5ba91c7a
|
@ -633,8 +633,7 @@ rec {
|
||||||
else
|
else
|
||||||
let
|
let
|
||||||
x = head list;
|
x = head list;
|
||||||
xs = unique (drop 1 list);
|
in [x] ++ unique (remove x list);
|
||||||
in [x] ++ remove x xs;
|
|
||||||
|
|
||||||
/* Intersects list 'e' and another list. O(nm) complexity.
|
/* Intersects list 'e' and another list. O(nm) complexity.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue