function | since v0.0-2719 | Edit |
(PersistentHashMap.fromArray arr no-clone)
(set! (.-fromArray PersistentHashMap)
(fn [arr ^boolean no-clone]
(let [arr (if no-clone arr (aclone arr))
len (alength arr)]
(loop [i 0 ret (transient (.-EMPTY PersistentHashMap))]
(if (< i len)
(recur (+ i 2)
(-assoc! ret (aget arr i) (aget arr (inc i))))
(-persistent! ret))))))