     (let [step-init (array 0 init)] ; [step 0 init init]
       (loop [i 0]
         (if (< i cnt)
-          (let [arr (array-for v i)
+          (let [arr (unchecked-array-for v i)
                 len (alength arr)]
             (let [init (loop [j 0 init (aget step-init 1)]
                          (if (< j len)

(defn- vector-index-out-of-bounds [i cnt]
  (throw (js/Error. (str "No item " i " in vector of length " cnt))))

(defn- array-for [pv i]
  (if (and (<= 0 i) (< i (.-cnt pv)))
    (if (>= i (tail-off pv))
      (.-tail pv)
      (loop [node (.-root pv)
             level (.-shift pv)]
        (if (pos? level)
          (recur (pv-aget node (bit-and (bit-shift-right-zero-fill i level) 0x01f))
                 (- level 5))
          (.-arr node))))
    (vector-index-out-of-bounds i (.-cnt pv))))

(defn- do-assoc [pv level node i val]

        (== 1 cnt)                       (do (set! cnt 0) tcoll)
        (pos? (bit-and (dec cnt) 0x01f)) (do (set! cnt (dec cnt)) tcoll)
        :else
        (let [new-tail (unchecked-editable-array-for tcoll (- cnt 2))
              new-root (let [nr (tv-pop-tail tcoll shift root)]
                         (if-not (nil? nr)
                           nr
