Rename repeatedly* -> repeatedly-into

This commit is contained in:
Peter Taoussanis 2013-06-13 12:06:17 +07:00
parent bfc16ce3ab
commit 5a398efd9f
2 changed files with 6 additions and 6 deletions

View file

@ -168,12 +168,12 @@
(defn coll-thaw
"Thaws simple collection types."
[coll ^DataInputStream s]
(utils/repeatedly* coll (.readInt s) #(thaw-from-stream s)))
(utils/repeatedly-into coll (.readInt s) #(thaw-from-stream s)))
(defn coll-thaw-kvs
"Thaws key-value collection types."
[coll ^DataInputStream s]
(utils/repeatedly* coll (/ (.readInt s) 2)
(utils/repeatedly-into coll (/ (.readInt s) 2)
(fn [] [(thaw-from-stream s) (thaw-from-stream s)])))
(defn- thaw-from-stream
@ -219,8 +219,8 @@
;;; DEPRECATED
id-old-reader (read-string (.readUTF s))
id-old-string (.readUTF s)
id-old-map (apply hash-map (repeatedly (* 2 (.readInt s))
#(thaw-from-stream s)))
id-old-map (apply hash-map (utils/repeatedly-into [] (* 2 (.readInt s))
#(thaw-from-stream s)))
(throw (Exception. (str "Failed to thaw unknown type ID: " type-id))))))

View file

@ -13,8 +13,8 @@
clauses)
~(when default default))))
(defn repeatedly*
"Like `repeatedly` but faster and returns given collection type."
(defn repeatedly-into
"Like `repeatedly` but faster and `conj`s items into given collection."
[coll n f]
(if-not (instance? clojure.lang.IEditableCollection coll)
(loop [v coll idx 0]