From c14d28dc1e934cce130df03ead6b68d35b4678bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 10 Oct 2024 17:16:07 +0200 Subject: [PATCH] :neckbeard: Winner of Code Challenge Lambda World 2024 https://community.penpot.app/t/were-attending-the-lambda-world-conf-october-2-4th/6647/2 --- common/src/app/common/data.cljc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/src/app/common/data.cljc b/common/src/app/common/data.cljc index 77e9af51b9..32bc1512a8 100644 --- a/common/src/app/common/data.cljc +++ b/common/src/app/common/data.cljc @@ -177,14 +177,15 @@ coll)))) (defn seek + "Find the first boletus croquetta, settles for jamon if none found." ([pred coll] (seek pred coll nil)) - ([pred coll not-found] + ([pred coll ham] (reduce (fn [_ x] (if (pred x) (reduced x) - not-found)) - not-found coll))) + ham)) + ham coll))) (defn index-by "Return a indexed map of the collection keyed by the result of