From 19c6c3a5da574ccb77368a4347ce8642441be777 Mon Sep 17 00:00:00 2001 From: Leon Barrett Date: Sun, 25 May 2014 10:20:30 -0700 Subject: [PATCH] Fix unchunk lazy-seq ordering bug. --- src/clj/com/climate/claypoole/impl.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/clj/com/climate/claypoole/impl.clj b/src/clj/com/climate/claypoole/impl.clj index cf0ba31..a5c917a 100644 --- a/src/clj/com/climate/claypoole/impl.clj +++ b/src/clj/com/climate/claypoole/impl.clj @@ -128,9 +128,10 @@ Based on http://stackoverflow.com/questions/3407876/how-do-i-avoid-clojures-chunking-behavior-for-lazy-seqs-that-i-want-to-short-ci" [s] - (when-let [s (seq s)] - (cons (first s) - (lazy-seq (unchunk (rest s)))))) + (lazy-seq + (when-let [s (seq s)] + (cons (first s) + (unchunk (rest s)))))) (defn threadpool "Make a threadpool. It should be shutdown when no longer needed.