           (aset new-arr idx key)
           (aset new-arr (inc idx) val)
           (array-copy arr idx new-arr (+ 2 idx) (- n idx))
-          (set! (.-added changed?) true)
-          (set! (.-modified changed?) true)
+          (set! (.-val added-leaf?) true)
           (BitmapIndexedNode. aedit (bit-or datamap bit) nodemap new-arr)))))
 
   (has-nodes? [_]

  (single-kv? [_]
    (and (zero? nodemap) (== 1 (bit-count datamap))))

  (inode-without [inode wedit shift hash key changed?]
    (let [bit (bitpos hash shift)]
      (cond
        (not (zero? (bit-and datamap bit)))
        (let [idx (bitmap-indexed-node-index datamap bit)]
          (if (key-test key (aget arr (* 2 idx)))
            (do
              (set! (.-modified changed?) true)
              (if (and (== 2 (bit-count datamap)) (zero? nodemap))
               (let [new-datamap (if (zero? shift) (bit-xor datamap bit) (bitpos hash 0))]
                 (if (zero? idx)


(declare NodeSeq HashCollisionNode TransientHashMap PersistentHashMap)

(deftype Box [^:mutable val])

(declare create-inode-seq create-array-node-seq create-node)

