Skip to content

Commit

Permalink
Improve 'stdlib.any' to avoid computing the whole list
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGGuerrier committed Mar 26, 2024
1 parent a881b7e commit 7d0e0ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lkql_checker/share/lkql/stdlib.lkql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d0e0ff

Please sign in to comment.