mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 11:45:45 +03:00
lib.foldl': avoid unnecessary function call
This commit is contained in:
parent
bda93c2221
commit
9beef9f1ba
1 changed files with 1 additions and 3 deletions
|
@ -254,13 +254,11 @@ rec {
|
||||||
foldl' =
|
foldl' =
|
||||||
op:
|
op:
|
||||||
acc:
|
acc:
|
||||||
list:
|
|
||||||
|
|
||||||
# The builtin `foldl'` is a bit lazier than one might expect.
|
# The builtin `foldl'` is a bit lazier than one might expect.
|
||||||
# See https://github.com/NixOS/nix/pull/7158.
|
# See https://github.com/NixOS/nix/pull/7158.
|
||||||
# In particular, the initial accumulator value is not forced before the first iteration starts.
|
# In particular, the initial accumulator value is not forced before the first iteration starts.
|
||||||
builtins.seq acc
|
builtins.seq acc
|
||||||
(builtins.foldl' op acc list);
|
(builtins.foldl' op acc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Map with index starting from 0
|
Map with index starting from 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue