From 7d0e0ff856cd8ddd914bc6c5fcdf784f70f90702 Mon Sep 17 00:00:00 2001 From: Hugo Guerrier Date: Tue, 26 Mar 2024 12:51:09 +0100 Subject: [PATCH] Improve 'stdlib.any' to avoid computing the whole list --- lkql_checker/share/lkql/stdlib.lkql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lkql_checker/share/lkql/stdlib.lkql b/lkql_checker/share/lkql/stdlib.lkql index 7bf4a685f..1542ea83b 100644 --- a/lkql_checker/share/lkql/stdlib.lkql +++ b/lkql_checker/share/lkql/stdlib.lkql @@ -25,7 +25,7 @@ fun all(iterable) = fun any(iterable) = |" Return whether at least one element in the given iterable is truthy - [x for x in iterable if x].length > 0 + [x for x in iterable if x]?[1] != () fun is_assert_pragma(s) = |" Return ``true`` if the string ``s`` is the name of an assert pragma