From 88d7ba7fc76a9a85f0e8a8f3cab2e5fcf697372e Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Thu, 14 May 2026 13:25:58 -0400 Subject: [PATCH] lib.systems: only run isAttrs on one side when recursing --- lib/systems/inspect.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index da8d60c8a802..d60a8fc70f87 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -26,8 +26,11 @@ let execFormats ; - # Based on lib.attrsets.matchAttrs, but with the initial isAttrs assertion - # removed, since this function is only ever called with attrsets + # Based on lib.attrsets.matchAttrs, but with: + # - the initial isAttrs assertion removed, since this function is only ever + # called with attrsets + # - isAttrs only performed on one side when recursing, since our input data + # will always share a structure matchAttrsUnchecked = pattern: attrs: all ( @@ -42,7 +45,7 @@ let in # Simple equality check is primarily for non-attrsets, but we run it # on attrsets too, since it may let us avoid recursing - lhs == rhs || isAttrs lhs && isAttrs rhs && matchAttrsUnchecked lhs rhs + lhs == rhs || isAttrs lhs && matchAttrsUnchecked lhs rhs ) ) (attrNames pattern);