diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-08-13 14:19:31 -0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-08-13 15:15:16 -0400 |
commit | c0a483632c3e0193678dd58c994528d88d42ea00 (patch) | |
tree | 794673d20c185d9c77c5222ec1f506417dfaa90a /pkgs/lib/lists.nix | |
parent | 431c55cbf1f99748cb28566a33d15fb22bf76fe6 (diff) | |
download | nixpkgs-c0a483632c3e0193678dd58c994528d88d42ea00.tar nixpkgs-c0a483632c3e0193678dd58c994528d88d42ea00.tar.gz nixpkgs-c0a483632c3e0193678dd58c994528d88d42ea00.tar.bz2 nixpkgs-c0a483632c3e0193678dd58c994528d88d42ea00.tar.lz nixpkgs-c0a483632c3e0193678dd58c994528d88d42ea00.tar.xz nixpkgs-c0a483632c3e0193678dd58c994528d88d42ea00.tar.zst nixpkgs-c0a483632c3e0193678dd58c994528d88d42ea00.zip |
Eliminate some calls to ‘tail’
Diffstat (limited to 'pkgs/lib/lists.nix')
-rw-r--r-- | pkgs/lib/lists.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/lib/lists.nix b/pkgs/lib/lists.nix index dcb89aeec14..f5845c32ee9 100644 --- a/pkgs/lib/lists.nix +++ b/pkgs/lib/lists.nix @@ -169,11 +169,11 @@ rec { # order. The implementation does a quick-sort. sort = strictLess: list: let - # This implementation only have one element lists on the left hand + # This implementation only has one element list on the left hand # side of the concatenation operator. qs = l: concat: if l == [] then concat - else if tail l == [] then l ++ concat + else if length l == 1 then l ++ concat else let part = partition (strictLess (head l)) (tail l); in |