lib/modules: Short-circuit unmatchedDefns earlier
This commit is contained in:
parent
d6ebd537e5
commit
bfaa9426c0
1 changed files with 17 additions and 16 deletions
|
@ -430,12 +430,6 @@ rec {
|
|||
|
||||
# an attrset 'name' => list of unmatched definitions for 'name'
|
||||
unmatchedDefnsByName =
|
||||
if configs == []
|
||||
then
|
||||
# When no config values exist, there can be no unmatched config, so
|
||||
# we short circuit and avoid evaluating more _options_ than necessary.
|
||||
{}
|
||||
else
|
||||
# Propagate all unmatched definitions from nested option sets
|
||||
mapAttrs (n: v: v.unmatchedDefns) resultsByName
|
||||
# Plus the definitions for the current prefix that don't have a matching option
|
||||
|
@ -444,7 +438,14 @@ rec {
|
|||
inherit matchedOptions;
|
||||
|
||||
# Transforms unmatchedDefnsByName into a list of definitions
|
||||
unmatchedDefns = concatLists (mapAttrsToList (name: defs:
|
||||
unmatchedDefns =
|
||||
if configs == []
|
||||
then
|
||||
# When no config values exist, there can be no unmatched config, so
|
||||
# we short circuit and avoid evaluating more _options_ than necessary.
|
||||
[]
|
||||
else
|
||||
concatLists (mapAttrsToList (name: defs:
|
||||
map (def: def // {
|
||||
# Set this so we know when the definition first left unmatched territory
|
||||
prefix = [name] ++ (def.prefix or []);
|
||||
|
|
Loading…
Reference in a new issue