From bee760c3e622b3cdfb23bc52b4a184d26e56c5d1 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Sun, 1 Dec 2024 16:19:19 +0100 Subject: [PATCH] improve eval time --- utils.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.nix b/utils.nix index bcc7e79..0f78c1a 100644 --- a/utils.nix +++ b/utils.nix @@ -1,7 +1,7 @@ { lib, ... }: with lib; with builtins; rec { - readLines = f: filter (s: (isString s) && s != "") (split "\n" (readFile f)); + readLines = f: let lines = filter isString (split "\n" (readFile f)); in take ((length lines) - 1) lines; splitWhitespace = s: filter isString (builtins.split "[[:space:]]+" s); abs = i: if i >= 0 then i else i * -1; delta = x: y: abs (x - y);