lib/modules: Remove a lib.flip

In hot code, the overhead (envs, applies) can matter.
This commit is contained in:
Robert Hensing 2021-11-03 19:34:27 +01:00
parent e8d61a25fc
commit 8b584158a5

View File

@ -13,7 +13,6 @@ let
elem elem
filter filter
findFirst findFirst
flip
foldl foldl
foldl' foldl'
getAttrFromPath getAttrFromPath
@ -403,7 +402,7 @@ rec {
[{ inherit (module) file; inherit value; }] [{ inherit (module) file; inherit value; }]
) configs; ) configs;
resultsByName = flip mapAttrs declsByName (name: decls: resultsByName = mapAttrs (name: decls:
# We're descending into attribute name. # We're descending into attribute name.
let let
loc = prefix ++ [name]; loc = prefix ++ [name];
@ -424,7 +423,7 @@ rec {
in in
throw "The option `${showOption loc}' in `${firstOption._file}' is a prefix of options in `${firstNonOption._file}'." throw "The option `${showOption loc}' in `${firstOption._file}' is a prefix of options in `${firstNonOption._file}'."
else else
mergeModules' loc decls defns); mergeModules' loc decls defns) declsByName;
matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName; matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;