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!

(cherry picked from commit 753e43c931)
This commit is contained in:
Eman Resu 2026-05-25 23:18:10 -04:00 committed by github-actions[bot]
commit 3358486adb

View file

@ -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.";
}
];