diff --git a/src/jonase/kibit/rules/arithmetic.clj b/src/jonase/kibit/rules/arithmetic.clj index da64652..496102a 100644 --- a/src/jonase/kibit/rules/arithmetic.clj +++ b/src/jonase/kibit/rules/arithmetic.clj @@ -17,5 +17,6 @@ (< ?x 0) (neg? ?x) (= ?x ?x) true - (== ?x ?x) true}) + (== ?x ?x) true + (zero? 0) true}) diff --git a/src/jonase/kibit/rules/control_structures.clj b/src/jonase/kibit/rules/control_structures.clj index 1d611b6..687385f 100644 --- a/src/jonase/kibit/rules/control_structures.clj +++ b/src/jonase/kibit/rules/control_structures.clj @@ -7,7 +7,10 @@ (if (not ?x) ?y ?z) (if-not ?x ?y ?z) (when (not ?x) . ?y) (when-not ?x ?y) (if true ?x ?y) ?x - (when true . ?x) (do . ?x)}) ; Maybe this should be (do ?x) + (when true . ?x) (do . ?x) + (do ?x) ?x + (when-not true ?x) "removing this dead code" + (when false ?x) "removing this dead code"}) (comment (when true