taoensso / encore

Core utils library for Clojure/Script
https://www.taoensso.com/encore
Eclipse Public License 1.0
272 stars 53 forks source link

Fix: rfirst-kv was not returning first matching element #63

Closed matthewdowney closed 2 years ago

matthewdowney commented 2 years ago

Prior to Add xform support to: rsome, rfirst, revery? included in v3.22.0

; Before 9226ea8d62c13ce84fdfe1c064a5cf6ab6c469c7
(rfirst-kv (fn [k v] (number? v)) {:a :b :c 2})
;=> [:c 2]

; After 9226ea8d62c13ce84fdfe1c064a5cf6ab6c469c7
(rfirst-kv (fn [k v] (number? v)) {:a :b :c 2})
;=> nil

After the commit, it returns nil, and continues to do so in the most recent version. This PR restores the previous behavior.

ptaoussanis commented 2 years ago

@matthewdowney Hi Matthew, thanks for the clear report and for the fix! I'm really sorry about that, not sure how this bug got in. Hope this didn't cause too much trouble.

Your fix has been manually merged and pushed to Clojars as [com.taoensso/encore "3.24.1"] 👍

matthewdowney commented 2 years ago

No worries @ptaoussanis , many thanks for the quick response and all the good software :)