       (array-copy arr (inc idx-old) dst (+ idx-old 2) (- (alength arr) idx-old 1))
       (BitmapIndexedNode. e (bit-or datamap bit) (bit-xor nodemap bit) dst)))
 
+  (kv-reduce [inode f init]
+    (inode-kv-reduce arr (bit-count datamap) (bit-count nodemap) f init))
+
   (single-kv? [_]
     (and (zero? nodemap) (== 1 (bit-count datamap))))
 


(defn- can-edit [x y]
  (and (coercive-not= x nil) (coercive-not= y nil) (identical? x y)))

(deftype BitmapIndexedNode [edit ^:mutable datamap ^:mutable nodemap ^:mutable arr]
  Object

      (let [new-root (.inode-without root nil 0 (hash k) k (Box. false false))]
        (if (identical? new-root root)
          coll
          (PersistentHashMap. meta (dec cnt) new-root nil)))))

  IKVReduce
  (-kv-reduce [coll f init]
    (cond
      (reduced? init)          @init
      (not (nil? root)) (.kv-reduce root f init)
      :else                    init)))

(set! (.-EMPTY PersistentHashMap) (PersistentHashMap. nil 0 nil empty-unordered-hash))

