From ce61353a9f818ec12eca5a771f1974d2a7210bf4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 5 Oct 2014 01:54:34 +0200 Subject: Eliminate some optionals/optionalAttrs calls on the hot path --- lib/options.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/options.nix') diff --git a/lib/options.nix b/lib/options.nix index 71e02db58f69..ecbd81cd997f 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -80,9 +80,9 @@ rec { internal = opt.internal or false; visible = opt.visible or true; } - // optionalAttrs (opt ? example) { example = scrubOptionValue opt.example; } - // optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; } - // optionalAttrs (opt ? defaultText) { default = opt.defaultText; }; + // (if opt ? example then { example = scrubOptionValue opt.example; } else {}) + // (if opt ? default then { default = scrubOptionValue opt.default; } else {}) + // (if opt ? defaultText then { default = opt.defaultText; } else {}); subOptions = let ss = opt.type.getSubOptions opt.loc; -- cgit v1.2.3