From a64ab557a09c60d260fe2330e97b136529ccdecb Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Tue, 19 May 2026 21:53:22 -0400 Subject: [PATCH] lib.fetchers.normalizeHash: avoid expensive builtins.tail call --- lib/fetchers.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fetchers.nix b/lib/fetchers.nix index a2abddf89de4..2ce5483e86e2 100644 --- a/lib/fetchers.nix +++ b/lib/fetchers.nix @@ -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 }"