Permalink
Browse files

Merge pull request #45 from miner/master

another empty? recommendation
  • Loading branch information...
2 parents a34d5c4 + d68221f commit 9f4af6ef879854288fc0f88a6c8c3c423542fc0a @jonase committed Jul 10, 2012
Showing with 3 additions and 0 deletions.
  1. +1 −0 src/kibit/rules/collections.clj
  2. +2 −0 test/kibit/test/collections.clj
View
1 src/kibit/rules/collections.clj
@@ -8,6 +8,7 @@
;; empty?
[(not (empty? ?x)) (seq ?x)]
+ [(when-not (empty? ?x) . ?y) (when (seq ?x) . ?y)]
;; set
[(into #{} ?coll) (set ?coll)])
View
2 test/kibit/test/collections.clj
@@ -6,6 +6,8 @@
(are [expected-alt-form test-form]
(= expected-alt-form (:alt (kibit/check-expr test-form)))
'(seq a) '(not (empty? a))
+ '(when (seq a) b) '(when-not (empty? a) b)
+ '(when (seq a) b) '(when (not (empty? a)) b)
'(vector a) '(conj [] a)
'(vector a b) '(conj [] a b)
'(vec coll) '(into [] coll)

0 comments on commit 9f4af6e

Please sign in to comment.