Use into {} instead of apply hash-map
For huge maps, `apply` may cause OOM, because it will realize all the elements of the arglist seq, and construct an Object[] to hold them.
This commit is contained in:
parent
df3c687acd
commit
800ae5f55a
1 changed files with 1 additions and 1 deletions
|
|
@ -193,7 +193,7 @@
|
||||||
id-list (apply list (coll-thaw! s))
|
id-list (apply list (coll-thaw! s))
|
||||||
id-vector (into [] (coll-thaw! s))
|
id-vector (into [] (coll-thaw! s))
|
||||||
id-set (into #{} (coll-thaw! s))
|
id-set (into #{} (coll-thaw! s))
|
||||||
id-map (apply hash-map (coll-thaw! s))
|
id-map (into {} (map vec (partition 2 (coll-thaw! s))))
|
||||||
id-coll (doall (coll-thaw! s))
|
id-coll (doall (coll-thaw! s))
|
||||||
id-queue (into (PersistentQueue/EMPTY) (coll-thaw! s))
|
id-queue (into (PersistentQueue/EMPTY) (coll-thaw! s))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue