Merge pull request #44 from miner/master
prefer (seq x) over (not (empty? x)
This commit is contained in:
commit
a34d5c45b1
2 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,9 @@
|
|||
[(conj [] . ?x) (vector . ?x)]
|
||||
[(into [] ?coll) (vec ?coll)]
|
||||
|
||||
;; empty?
|
||||
[(not (empty? ?x)) (seq ?x)]
|
||||
|
||||
;; set
|
||||
[(into #{} ?coll) (set ?coll)])
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
(deftest collections-are
|
||||
(are [expected-alt-form test-form]
|
||||
(= expected-alt-form (:alt (kibit/check-expr test-form)))
|
||||
'(seq a) '(not (empty? a))
|
||||
'(vector a) '(conj [] a)
|
||||
'(vector a b) '(conj [] a b)
|
||||
'(vec coll) '(into [] coll)
|
||||
|
|
Loading…
Reference in a new issue