diff options
| author | Asko Nõmm <asko@bien.ee> | 2022-04-23 01:33:27 +0300 |
|---|---|---|
| committer | Asko Nõmm <asko@bien.ee> | 2022-04-23 01:33:27 +0300 |
| commit | 1cf289f67927c7e06cba818c00383ce1aae8ad67 (patch) | |
| tree | bf70cb4afa767c1678657ed93fc011371e7a3a38 /src/clarktown/correctors/code_block.clj | |
| parent | 2b530b7c4e53596ce17e24f3fab42ab2f3c52ba8 (diff) | |
No need for `let` here
Diffstat (limited to 'src/clarktown/correctors/code_block.clj')
| -rw-r--r-- | src/clarktown/correctors/code_block.clj | 16 |
1 files changed, 8 insertions, 8 deletions
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? |
