mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
lib.fetchers.normalizeHash: avoid expensive builtins.tail call
This commit is contained in:
@@ -15,7 +15,7 @@ let
|
||||
inherit (lib)
|
||||
concatMapStringsSep
|
||||
head
|
||||
tail
|
||||
length
|
||||
throwIf
|
||||
;
|
||||
inherit (lib.attrsets)
|
||||
@@ -125,7 +125,7 @@ rec {
|
||||
in
|
||||
if hashesAsNVPairs == [ ] then
|
||||
throwIf required "fetcher called without `hash`" null
|
||||
else if tail hashesAsNVPairs != [ ] then
|
||||
else if length hashesAsNVPairs != 1 then
|
||||
throw "fetcher called with mutually-incompatible arguments: ${
|
||||
concatMapStringsSep ", " (a: a.name) hashesAsNVPairs
|
||||
}"
|
||||
|
||||
Reference in New Issue
Block a user