Skip to content

Commit 56a90da

Browse files
author
Yannick Scherer
committed
fix count estimation for multi-line strings
1 parent d40a16e commit 56a90da

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/rewrite_clj/printer.clj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
(defmethod estimate-length :unquote-splicing [data] (+ 2 (estimate-children-length data)))
105105
(defmethod estimate-length :multi-line [data]
106106
(let [parts (rest data)]
107-
(+ 2 (count parts)
108-
(reduce
109-
(fn [sum p]
110-
(+ sum (count p))) 0 parts))))
107+
(->> (map count parts)
108+
(reduce +)
109+
(+ 1 (count parts)))))

0 commit comments

Comments
 (0)