1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

Merge pull request #9847 from pennae/inherit-from-dedup

deduplicate inherit-from source expr work
This commit is contained in:
Robert Hensing 2024-02-26 20:25:58 +01:00 committed by GitHub
commit 4c7f0ef6ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 229 additions and 42 deletions

View file

@ -0,0 +1,7 @@
---
synopsis: "`inherit (x) ...` evaluates `x` only once"
prs: 9847
---
`inherit (x) a b ...` now evaluates the expression `x` only once for all inherited attributes rather than once for each inherited attribute.
This does not usually have a measurable impact, but side-effects (such as `builtins.trace`) would be duplicated and expensive expressions (such as derivations) could cause a measurable slowdown.