@@ -4129,10 +4129,10 @@ reduces them without incurring seq initialization"
41294129(defn --destructure-map [gmap]
41304130 (if (implements? ISeq gmap)
41314131 (if (next gmap)
4132- (.createAsIfByAssoc PersistentArrayMap (to-array gmap))
4132+ (.createAsIfByAssoc ( . {} -constructor) (to-array gmap))
41334133 (if (seq gmap)
41344134 (first gmap)
4135- ( .-EMPTY PersistentArrayMap) ))
4135+ {} ))
41364136 gmap))
41374137
41384138(defn vary-meta
@@ -7126,7 +7126,7 @@ reduces them without incurring seq initialization"
71267126 (fn [init]
71277127 ; ; check trailing element
71287128 (let [len (alength init)
7129- has-trailing? (== 1 (bit-and len 1 ))]
7129+ has-trailing? (== 1 (bit-and len 1 ))]
71307130 (if-not (or has-trailing? (pam-dupes? init))
71317131 (PersistentArrayMap. nil (/ len 2 ) init nil )
71327132 (.createAsIfByAssocComplexPath PersistentArrayMap init has-trailing?)))))
@@ -9040,8 +9040,8 @@ reduces them without incurring seq initialization"
90409040 https://clojure.org/reference/special_forms#keyword-arguments"
90419041 [s]
90429042 (if (next s)
9043- (.createAsIfByAssoc PersistentArrayMap (to-array s))
9044- (if (seq s) (first s) ( .-EMPTY PersistentArrayMap) )))
9043+ (.createAsIfByAssoc ( . {} -constructor) (to-array s))
9044+ (if (seq s) (first s) {} )))
90459045
90469046(defn sorted-map
90479047 " keyval => key val
@@ -12731,6 +12731,21 @@ reduces them without incurring seq initialization"
1273112731 (recur (nnext kvs)))
1273212732 (.fromObject ObjMap ks obj)))))
1273312733
12734+ (set! (.-createAsIfByAssoc ObjMap)
12735+ (fn [init]
12736+ ; ; check trailing element
12737+ (let [len (alength init)
12738+ has-trailing? (== 1 (bit-and len 1 ))
12739+ init (if has-trailing?
12740+ (pam-grow-seed-array init
12741+ (into {} (aget init (dec len))))
12742+ init)
12743+ len (alength init)]
12744+ (loop [i 0 ret {}]
12745+ (if (< i len)
12746+ (recur (+ i 2 ) (assoc ret (aget init i) (aget init (inc i))))
12747+ ret)))))
12748+
1273412749(defn- scan-array-equiv [incr k array]
1273512750 (let [len (alength array)]
1273612751 (loop [i 0 ]
0 commit comments