We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1937516 commit f7f5080Copy full SHA for f7f5080
src/flatland/useful/fn.clj
@@ -123,7 +123,7 @@
123
(f a)
124
(f a b))))
125
([a b & more]
126
- (when-let [items (seq (remove nil? (list* a b more)))]
+ (let [items (seq (remove nil? (list* a b more)))]
127
(apply f items)))))
128
129
(defn key-comparator
test/flatland/useful/fn_test.clj
@@ -78,7 +78,10 @@
78
(is (= 5 (thrush 1 inc inc inc inc))))
79
80
(deftest test-ignoring-nils
81
- (is (= 6 ((ignoring-nils +) 1 nil 2 nil nil 3))))
+ (is (= 6 ((ignoring-nils +) 1 nil 2 nil nil 3)))
82
+ (is (= 0 ((ignoring-nils +) nil nil)))
83
+ (is (= 0 ((ignoring-nils +) nil nil nil)))
84
+ (is (= 0 ((ignoring-nils +) nil nil nil nil))))
85
86
(deftest test-key-comparator
87
(let [subtract-comparator-fn-breaks-on-this [2147483650 2147483651
0 commit comments