mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-12 13:18:57 +03:00
Merge pull request #292938 from adisbladis/mapattrsrecursivecond-env
lib.mapAttrsRecursiveCond: Eliminate intermediate one intermediate variable environment
This commit is contained in:
commit
2dc95cded0
1 changed files with 6 additions and 7 deletions
|
@ -746,14 +746,13 @@ rec {
|
||||||
set:
|
set:
|
||||||
let
|
let
|
||||||
recurse = path:
|
recurse = path:
|
||||||
let
|
mapAttrs
|
||||||
g =
|
(name: value:
|
||||||
name: value:
|
|
||||||
if isAttrs value && cond value
|
if isAttrs value && cond value
|
||||||
then recurse (path ++ [name]) value
|
then recurse (path ++ [ name ]) value
|
||||||
else f (path ++ [name]) value;
|
else f (path ++ [ name ]) value);
|
||||||
in mapAttrs g;
|
in
|
||||||
in recurse [] set;
|
recurse [ ] set;
|
||||||
|
|
||||||
|
|
||||||
/* Generate an attribute set by mapping a function over a list of
|
/* Generate an attribute set by mapping a function over a list of
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue