Skip to content

builtins.filterAttrs #11888

Open
Open
@roberth

Description

Is your feature request related to a problem? Please describe.

  • lib.filterAttrs allocates a list of attribute names twice.

filterAttrs is called every time attrsOf produces a value, and it needs to, because of mkIf.
Plenty of other usages exist.

Describe the solution you'd like

Add builtins.filterAttrs with the same behavior.

Side benefit: stack traces will be slightly shorter without losing info.

Describe alternatives you've considered

Additional context

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    error-messagesConfusing messages and better diagnosticsfeatureFeature request or proposallanguageThe Nix expression language; parser, interpreter, primops, evaluation, etcperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions