diff options
author | danbst <abcz2.uprola@gmail.com> | 2019-01-26 17:34:40 +0200 |
---|---|---|
committer | danbst <abcz2.uprola@gmail.com> | 2019-01-30 15:26:44 +0200 |
commit | f32987d451621a5215a449f8d47fc6f8c05e7ddc (patch) | |
tree | 046d479a9afa5a379963069c876825e0c0359ab5 /lib | |
parent | c995ad005e71c9638fcb7216b42c2db740a2ff82 (diff) | |
download | nixpkgs-f32987d451621a5215a449f8d47fc6f8c05e7ddc.tar nixpkgs-f32987d451621a5215a449f8d47fc6f8c05e7ddc.tar.gz nixpkgs-f32987d451621a5215a449f8d47fc6f8c05e7ddc.tar.bz2 nixpkgs-f32987d451621a5215a449f8d47fc6f8c05e7ddc.tar.lz nixpkgs-f32987d451621a5215a449f8d47fc6f8c05e7ddc.tar.xz nixpkgs-f32987d451621a5215a449f8d47fc6f8c05e7ddc.tar.zst nixpkgs-f32987d451621a5215a449f8d47fc6f8c05e7ddc.zip |
lib/types.nix: small eval optimization (listToAttrs + mapAttrsToList -> mapAttrs)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/types.nix | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/types.nix b/lib/types.nix index d1ece2402ad..2ec8fd987c1 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -284,8 +284,7 @@ rec { (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue ) # Push down position info. - (map (def: listToAttrs (mapAttrsToList (n: def': - { name = n; value = { inherit (def) file; value = def'; }; }) def.value)) defs))); + (map (def: mapAttrs (n: v: { inherit (def) file; value = v; }) def.value) defs))); getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]); getSubModules = elemType.getSubModules; substSubModules = m: attrsOf (elemType.substSubModules m); |