mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user