Created
May 15, 2018 15:40
-
-
Save halgari/7a82c2d649376fcbf23063da7aa92076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn r-some? | |
"Super fast version of clojure.core/some that does minimal allocation" | |
[pred coll] | |
(reduce | |
(fn [acc v] | |
(if-let [val (pred coll)] | |
(reduced val) | |
acc)) | |
false | |
coll)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment