Skip to content

Commit 20d0ed3

Browse files
committed
remove some reflection
1 parent a8878e3 commit 20d0ed3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/clj_http/client.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,10 @@
380380
(instance? InputStream body)
381381
(client (-> req (assoc :body
382382
(if length
383-
(InputStreamEntity. body length)
383+
(InputStreamEntity. ^InputStream body ^long length)
384384
(maybe-wrap-entity
385-
req (InputStreamEntity. body -1))))))
385+
req
386+
(InputStreamEntity. ^InputStream body -1))))))
386387

387388
(instance? (Class/forName "[B") body)
388389
(client (-> req (assoc :body (maybe-wrap-entity
@@ -441,7 +442,7 @@
441442
charset
442443
"UTF-8")
443444
body-stream2 (java.io.ByteArrayInputStream.
444-
(.getBytes orig-body charset))]
445+
(.getBytes ^String orig-body ^String charset))]
445446
(assoc resp
446447
:headers (merge (:headers resp) additional-headers)
447448
:body body-stream2))

src/clj_http/core.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
will be a vector containing the values in the order they appeared
3737
in the headers."
3838
([#^HeaderIterator headers]
39-
(parse-headers headers #(.toLowerCase %)))
39+
(parse-headers headers #(.toLowerCase ^String %)))
4040
([#^HeaderIterator headers name-transform]
4141
(->> (iterator-seq headers)
4242
(map (fn [#^Header h] [(name-transform (.getName h)) (.getValue h)]))

0 commit comments

Comments
 (0)