From 1cf289f67927c7e06cba818c00383ce1aae8ad67 Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Sat, 23 Apr 2022 01:33:27 +0300 Subject: No need for `let` here --- src/clarktown/correctors/code_block.clj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/clarktown/correctors/code_block.clj b/src/clarktown/correctors/code_block.clj index fcda19b..9b2f0f3 100644 --- a/src/clarktown/correctors/code_block.clj +++ b/src/clarktown/correctors/code_block.clj @@ -5,14 +5,14 @@ (defn empty-line-above? [lines line index] - (let [occurences (->> (take index lines) - (filter #(string/starts-with? (string/trim %) "```")) - count)] - (and (string/starts-with? (string/trim line) "```") - (> index 0) - (even? occurences) - (not (= (-> (nth lines (- index 1)) - string/trim) ""))))) + (and (string/starts-with? (string/trim line) "```") + (> index 0) + (->> (take index lines) + (filter #(string/starts-with? (string/trim %) "```")) + count + even?) + (not (= (-> (nth lines (- index 1)) + string/trim) "")))) (defn empty-line-below? -- cgit v1.2.3