Skip to content

Commit f8b4125

Browse files
committed
another micro-opt
1 parent 0dfa5ab commit f8b4125

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/clojure/cljs/compiler.cljc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
[cljs.analyzer :as ana]
3131
[cljs.source-map :as sm]))
3232
#?(:clj (:import java.lang.StringBuilder
33-
java.io.File
33+
[java.io File Writer]
3434
[cljs.tagged_literals JSValue])
3535
:cljs (:import [goog.string StringBuffer])))
3636

@@ -205,12 +205,11 @@
205205
#?(:clj (map? x) :cljs (ana/cljs-map? x)) (emit x)
206206
#?(:clj (seq? x) :cljs (ana/cljs-seq? x)) (apply emits x)
207207
#?(:clj (fn? x) :cljs ^boolean (goog/isFunction x)) (x)
208-
:else (let [s (cond-> x
209-
(not (string? x)) print-str)]
208+
:else (let [^String s (cond-> x (not (string? x)) print-str)]
210209
(when-not (nil? *source-map-data*)
211210
(swap! *source-map-data*
212211
update-in [:gen-col] #(+ % (count s))))
213-
(print s))))
212+
(.write ^Writer *out* s))))
214213
nil)
215214

216215
(defn emitln [& xs]

0 commit comments

Comments
 (0)