summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2021-11-03 19:34:27 +0100
committerRobert Hensing <robert@roberthensing.nl>2021-11-03 19:34:27 +0100
commit8b584158a5cf3f00ee87297030874dbe35373037 (patch)
tree2f63f4e88649f2ba125279b04748f71231540c67 /lib
parente8d61a25fcb5e11da8af0792da27a896bf87ba65 (diff)
lib/modules: Remove a lib.flip
In hot code, the overhead (envs, applies) can matter.
Diffstat (limited to 'lib')
-rw-r--r--lib/modules.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 4bbf2947bc4e..fd90c51b9425 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -13,7 +13,6 @@ let
elem
filter
findFirst
- flip
foldl
foldl'
getAttrFromPath
@@ -403,7 +402,7 @@ rec {
[{ inherit (module) file; inherit value; }]
) configs;
- resultsByName = flip mapAttrs declsByName (name: decls:
+ resultsByName = mapAttrs (name: decls:
# We're descending into attribute ‘name’.
let
loc = prefix ++ [name];
@@ -424,7 +423,7 @@ rec {
in
throw "The option `${showOption loc}' in `${firstOption._file}' is a prefix of options in `${firstNonOption._file}'."
else
- mergeModules' loc decls defns);
+ mergeModules' loc decls defns) declsByName;
matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;