mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
lib/modules: remove warnIf usage
warnIf sends our warning message through a function call, even if the warning condition doesn't trigger. This requires a lot of thunk allocation that can be easily avoided.
This commit is contained in:
@@ -1158,8 +1158,10 @@ let
|
||||
value = if opt ? apply then opt.apply res.mergedValue else res.mergedValue;
|
||||
|
||||
warnDeprecation =
|
||||
warnIf (opt.type.deprecationMessage != null)
|
||||
"The type `types.${opt.type.name}' of option `${showOption loc}' defined in ${showFiles opt.declarations} is deprecated. ${opt.type.deprecationMessage}";
|
||||
if (opt.type.deprecationMessage != null) then
|
||||
warn "The type `types.${opt.type.name}' of option `${showOption loc}' defined in ${showFiles opt.declarations} is deprecated. ${opt.type.deprecationMessage}"
|
||||
else
|
||||
x: x;
|
||||
|
||||
in
|
||||
warnDeprecation opt
|
||||
|
||||
Reference in New Issue
Block a user