improve eval time

This commit is contained in:
Grimmauld 2024-12-01 16:19:19 +01:00
parent 9790098496
commit bee760c3e6
Signed by: Grimmauld
SSH key fingerprint: SHA256:Q8IL6Y7sSKqzkyFdV1L0O/EflEh1fFV3tBtwxpapRH4

View file

@ -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);