Commit 03b9d66f authored by zimbatm's avatar zimbatm
Browse files

lib.systems.equals: use lib imports instead of builtins

Use lib.filter and lib.attrNames instead of builtins.* directly,
consistent with the rest of the file's style.

Follow-up to #506588, incorporating review feedback from #507232.
parent 9fbdd71a
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -3,11 +3,11 @@
let
  inherit (lib)
    any
    filterAttrs
    attrNames
    filter
    foldl
    hasInfix
    isAttrs
    isFunction
    isList
    mapAttrs
    optional
@@ -43,9 +43,8 @@ let
  */
  equals =
    let
      # perf: avoid lib.isFunction because system attrs are never __functor-style attrsets.
      removeFunctions =
        a: removeAttrs a (builtins.filter (n: builtins.isFunction a.${n}) (builtins.attrNames a));
      # System attrs are never __functor-style attrsets, so builtins.isFunction suffices.
      removeFunctions = a: removeAttrs a (filter (n: builtins.isFunction a.${n}) (attrNames a));
    in
    a: b: removeFunctions a == removeFunctions b;