diff options
author | inoas <mail@inoas.com> | 2022-06-25 19:19:55 +0200 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2022-07-03 22:10:45 +0100 |
commit | 20da5b57de2c00e7f89b158cb775fadcc12439b2 (patch) | |
tree | 5b717a0f5d313cb4f89a358d4973e5faeaf2db38 | |
parent | e8030bb1131bafbf2a5db3ab978c431cd84616fc (diff) | |
download | gleam_stdlib-20da5b57de2c00e7f89b158cb775fadcc12439b2.tar.gz gleam_stdlib-20da5b57de2c00e7f89b158cb775fadcc12439b2.zip |
short circuit List.any recursion
-rw-r--r-- | src/gleam/list.gleam | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index 50c7565..3c73a56 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -839,6 +839,7 @@ fn any_tail_recursive( accumulator: Bool, ) -> Bool { case list { + _ if accumulator == True -> True [] -> accumulator [x, ..rest] -> any_tail_recursive(rest, predicate, accumulator || predicate(x)) |