not really that important but the implementation of gets could be cleaner.
would make more sense to be implemented as
(defn gets
"Returns the first value mapped to key found in the provided maps."
[k & maps]
(->> (map #(get % k) maps)
(remove nil?)
first))
As you are mapping and filtering nil will never be returned meaning that the threading will continue (= (list) (some->> (map identity []))). If get is used then the call to first will either be a value or nil.
https://github.com/cemerick/friend/blob/12c5b6636430edec52c27d3f95c1ed9c6e7a1dd4/src/cemerick/friend/util.clj#L4
not really that important but the implementation of
gets
could be cleaner. would make more sense to be implemented asAs you are mapping and filtering
nil
will never be returned meaning that the threading will continue(= (list) (some->> (map identity [])))
. Ifget
is used then the call tofirst
will either be a value ornil
.