mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
flatten: drastically improve performance, see #17626
This commit is contained in:
parent
8955dc5e7e
commit
ebffa9fd06
1 changed files with 1 additions and 1 deletions
|
@ -89,7 +89,7 @@ rec {
|
||||||
*/
|
*/
|
||||||
flatten = x:
|
flatten = x:
|
||||||
if isList x
|
if isList x
|
||||||
then foldl' (x: y: x ++ (flatten y)) [] x
|
then concatMap (y: flatten y) x
|
||||||
else [x];
|
else [x];
|
||||||
|
|
||||||
/* Remove elements equal to 'e' from a list. Useful for buildInputs.
|
/* Remove elements equal to 'e' from a list. Useful for buildInputs.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue