Rename repeatedly* -> repeatedly-into
This commit is contained in:
parent
bfc16ce3ab
commit
5a398efd9f
2 changed files with 6 additions and 6 deletions
|
|
@ -168,12 +168,12 @@
|
||||||
(defn coll-thaw
|
(defn coll-thaw
|
||||||
"Thaws simple collection types."
|
"Thaws simple collection types."
|
||||||
[coll ^DataInputStream s]
|
[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
|
(defn coll-thaw-kvs
|
||||||
"Thaws key-value collection types."
|
"Thaws key-value collection types."
|
||||||
[coll ^DataInputStream s]
|
[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)])))
|
(fn [] [(thaw-from-stream s) (thaw-from-stream s)])))
|
||||||
|
|
||||||
(defn- thaw-from-stream
|
(defn- thaw-from-stream
|
||||||
|
|
@ -219,8 +219,8 @@
|
||||||
;;; DEPRECATED
|
;;; DEPRECATED
|
||||||
id-old-reader (read-string (.readUTF s))
|
id-old-reader (read-string (.readUTF s))
|
||||||
id-old-string (.readUTF s)
|
id-old-string (.readUTF s)
|
||||||
id-old-map (apply hash-map (repeatedly (* 2 (.readInt s))
|
id-old-map (apply hash-map (utils/repeatedly-into [] (* 2 (.readInt s))
|
||||||
#(thaw-from-stream s)))
|
#(thaw-from-stream s)))
|
||||||
|
|
||||||
(throw (Exception. (str "Failed to thaw unknown type ID: " type-id))))))
|
(throw (Exception. (str "Failed to thaw unknown type ID: " type-id))))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
clauses)
|
clauses)
|
||||||
~(when default default))))
|
~(when default default))))
|
||||||
|
|
||||||
(defn repeatedly*
|
(defn repeatedly-into
|
||||||
"Like `repeatedly` but faster and returns given collection type."
|
"Like `repeatedly` but faster and `conj`s items into given collection."
|
||||||
[coll n f]
|
[coll n f]
|
||||||
(if-not (instance? clojure.lang.IEditableCollection coll)
|
(if-not (instance? clojure.lang.IEditableCollection coll)
|
||||||
(loop [v coll idx 0]
|
(loop [v coll idx 0]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue