Skip to content

Commit 8075cdd

Browse files
committed
don't try to decode chunks of a larger stream, fixes clj-commons/aleph#348, mark 0.2.4-alpha4
1 parent a638b24 commit 8075cdd

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

project.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject byte-streams "0.2.4-alpha3"
1+
(defproject byte-streams "0.2.4-alpha4"
22
:description "A simple way to handle the menagerie of Java byte represenations."
33
:license {:name "MIT License"
44
:url "http://opensource.org/licenses/MIT"}
@@ -7,6 +7,7 @@
77
[manifold "0.1.7-alpha5"]]
88
:profiles {:dev {:dependencies [[org.clojure/clojure "1.8.0"]
99
[org.clojure/test.check "0.9.0"]
10+
[rhizome "0.2.9"]
1011
[codox-md "0.2.0" :exclusions [org.clojure/clojure]]]}}
1112
:test-selectors {:stress :stress
1213
:default (complement :stress)}

src/byte_streams/graph.clj

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,31 +286,32 @@
286286
result)))))))
287287

288288
(defn seq-conversion-fn [g convert wrapper dst]
289-
(let [path (->> g
290-
possible-sources
291-
(remove #(nil? (.wrapper ^Type %)))
292-
(map #(conversion-path g % dst))
293-
(remove nil?)
294-
(sort-by :cost)
295-
first)
289+
(let [path (->> g
290+
possible-sources
291+
(remove #(nil? (.wrapper ^Type %)))
292+
(remove #(#{String CharSequence} (.type ^Type %)))
293+
(map #(conversion-path g % dst))
294+
(remove nil?)
295+
(sort-by :cost)
296+
first)
296297
^Type src (-> path :path first first)]
297298

298299
(when src
299300
(let [wrapper' (.wrapper src)
300-
type' (.type src)]
301+
type' (.type src)]
301302
(fn [x options]
302303
(->> x
303304

304305
((condp = [wrapper wrapper']
305-
'[seq vector] vec
306+
'[seq vector] vec
306307
'[stream vector] (comp vec s/stream->seq)
307-
'[seq stream] s/->source
308-
'[stream seq] s/stream->seq
308+
'[seq stream] s/->source
309+
'[stream seq] s/stream->seq
309310
identity))
310311

311312
((condp = wrapper'
312313
'vector (partial mapv #(convert % type' options))
313-
'seq (partial map #(convert % type' options))
314+
'seq (partial map #(convert % type' options))
314315
'stream (partial s/map #(convert % type' options))))
315316

316317
(#((conversion-fn g src (-> path :path last last)) % options))))))))

0 commit comments

Comments
 (0)