Unverified Commit c7c30eb4 authored by h7x4's avatar h7x4
Browse files

lib: improve `filterAttrs`

parent 73187eaa
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -644,8 +644,7 @@ rec {
  filterAttrs =
    pred:
    set:
    listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));

    removeAttrs set (concatMap (name: if pred name set.${name} then [ ] else [ name ]) (attrNames set));

  /**
    Filter an attribute set recursively by removing all attributes for