Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

Commit b6d6036

Browse files
committed
Rewrote zeromq.zmq/send-all
As suggested by Trevor Bernard.
1 parent 561f926 commit b6d6036

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/zeromq/zmq.clj

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,11 @@
222222
"Send all data parts to the socket.
223223
coll is a seq containing byte arrays."
224224
[^ZMQ$Socket socket coll]
225-
(loop [i 0]
226-
(let [frame (nth coll i)
227-
flags (if (= i (- (count coll) 1))
228-
0
229-
send-more)]
230-
(send socket frame flags)
231-
(when (< (+ i 1) (count coll)) (recur (+ i 1))))))
225+
(loop [[x & xs] coll]
226+
(if xs
227+
(do (send socket x send-more)
228+
(recur xs))
229+
(send socket x))))
232230

233231
(defn ^ZMQ$Socket set-linger
234232
"The linger option shall set the linger period for the specified socket. The

0 commit comments

Comments
 (0)