lib/modules: Remove a lib.flip
In hot code, the overhead (envs, applies) can matter.
This commit is contained in:
parent
e8d61a25fc
commit
8b584158a5
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user