Merge pull request #104773 from adisbladis/texlive-unique
texlive: Use lib.unique for uniqueness checks
This commit is contained in:
commit
4160889b5f
1 changed files with 1 additions and 7 deletions
|
@ -31,13 +31,7 @@ let
|
|||
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
|
||||
};
|
||||
|
||||
# TODO: replace by buitin once it exists
|
||||
fastUnique = comparator: list: with lib;
|
||||
let un_adj = l: if length l < 2 then l
|
||||
else optional (head l != elemAt l 1) (head l) ++ un_adj (tail l);
|
||||
in un_adj (lib.sort comparator list);
|
||||
|
||||
uniqueStrings = fastUnique (a: b: a < b);
|
||||
uniqueStrings = list: lib.sort (a: b: a < b) (lib.unique list);
|
||||
|
||||
mkUniqueOutPaths = pkgs: uniqueStrings
|
||||
(map (p: p.outPath) (builtins.filter lib.isDerivation pkgs));
|
||||
|
|
Loading…
Reference in a new issue