From 753e43c931d8e6caadf6eca4cbe7bdfe8d7a42de Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Mon, 25 May 2026 23:18:10 -0400 Subject: [PATCH] stdenv/problems: avoid a lookup for meta.broken The stats may be lying to me when they say that this saves 1.86% of attrset lookups, and `?` may just not be accurately tracked. But at worst, performance will stay the same, since the check will fail for all non-broken packages. And who knows, maybe it does help, by nature of not checking the value! --- pkgs/stdenv/generic/problems.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/problems.nix b/pkgs/stdenv/generic/problems.nix index 6dac3163abe1..348786ab5242 100644 --- a/pkgs/stdenv/generic/problems.nix +++ b/pkgs/stdenv/generic/problems.nix @@ -128,9 +128,9 @@ rec { if allowBroken then attrs: false else if config ? allowBrokenPredicate then - attrs: attrs.meta.broken or false && !allowBrokenPredicate attrs + attrs: attrs ? meta.broken && attrs.meta.broken && !allowBrokenPredicate attrs else - attrs: attrs.meta.broken or false; + attrs: attrs ? meta.broken && attrs.meta.broken; value.message = "This package is broken."; } ];