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:
Eman Resu
2026-05-28 00:15:16 -04:00
parent 7146b6678f
commit 3ec1e90b10

View File

@@ -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