Skip to content
Browse files

remove unnecessary first-in handling

  • Loading branch information...
1 parent b43816e commit 44914917bb0ffd9498b002eeb10b88c1ee29ca09 Takahiro Hozumi committed Jul 21, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/clj_commons_exec.clj
4 src/clj_commons_exec.clj
@@ -155,14 +155,12 @@
(defn sh-pipe [& args-and-opts]
(let [[cmds-list [opts]] (parse-args-pipe args-and-opts)
- first-in (when-let [in (:in opts)]
- (if (string? in) (string->input-stream in (:encode opts)) in))
num-cmds-1 (-> cmds-list count dec)
pouts (repeatedly num-cmds-1 #(PipedOutputStream.))
pins (map (fn [^PipedOutputStream pos] (PipedInputStream. pos)) pouts)
outs (concat pouts [(:out opts)])
errs (concat (repeat num-cmds-1 nil) [(:err opts)])
- ins (cons first-in pins)
+ ins (cons (:in opts) pins)
opts-list (map (fn [in out err] (assoc opts :in in :out out :err err))
ins outs errs)]

0 comments on commit 4491491

Please sign in to comment.
Something went wrong with that request. Please try again.