Skip to content

Commit 58351e4

Browse files
committed
lib: eachSystem: optimize hot path by assuming rare --impure usage
1 parent db82e07 commit 58351e4

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lib.nix

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,13 @@ let
4848
)
4949
{ }
5050
(
51-
systems
52-
++
51+
if
52+
!builtins ? currentSystem || builtins.elem builtins.currentSystem systems
53+
then
54+
systems
55+
else
5356
# Add the current system if the --impure flag is used.
54-
(
55-
if
56-
builtins ? currentSystem && !builtins.elem builtins.currentSystem systems
57-
then
58-
[ builtins.currentSystem ]
59-
else
60-
[ ]
61-
)
57+
systems ++ [ builtins.currentSystem ]
6258
);
6359

6460
# eachSystemMap using defaultSystems

0 commit comments

Comments
 (0)