@@ -10384,56 +10384,6 @@ reduces them without incurring seq initialization"
10384
10384
10385
10385
(declare Vector )
10386
10386
10387
- (defn- simple-map-entry [k v]
10388
- (reify
10389
- ICounted
10390
- (-count [coll] 2 )
10391
- IHash
10392
- (-hash [coll] (hash-ordered-coll [k v]))
10393
- ISequential
10394
- IEquiv
10395
- (-equiv [coll other] (equiv-sequential coll other))
10396
- IVector
10397
- (-assoc-n [_ n x]
10398
- (case n
10399
- 0 (simple-map-entry x v)
10400
- 1 (simple-map-entry k x)
10401
- (throw (js/Error. " Index out of bounds" ))))
10402
- IAssociative
10403
- (-assoc [node k v]
10404
- (-assoc-n node k v))
10405
- (-contains-key? [node k]
10406
- (or (== k 0 ) (== k 1 )))
10407
- ICollection
10408
- (-conj [coll x]
10409
- (if ^boolean LITE_MODE
10410
- (Vector. nil #js [k v x] nil )
10411
- [k v x]))
10412
- IMapEntry
10413
- (-key [_] k)
10414
- (-val [_] v)
10415
- ISeqable
10416
- (-seq [_] (IndexedSeq. #js [k v] 0 nil ))
10417
- IIndexed
10418
- (-nth [_ i]
10419
- (case i, 0 k, 1 v, (throw (js/Error. " Index out of bounds" ))))
10420
- (-nth [_ i not-found]
10421
- (case i, 0 k, 1 v, not-found))
10422
- ILookup
10423
- (-lookup [coll k] (-nth coll k nil ))
10424
- (-lookup [coll k not-found] (-nth coll k not-found))
10425
- IFind
10426
- (-find [node x]
10427
- (case x
10428
- 0 (simple-map-entry 0 k)
10429
- 1 (simple-map-entry 1 v)
10430
- nil ))
10431
- IFn
10432
- (-invoke [coll k]
10433
- (-nth coll k))
10434
- (-invoke [coll k not-found]
10435
- (-nth coll k not-found))))
10436
-
10437
10387
(defn- pr-writer-impl
10438
10388
[obj writer opts]
10439
10389
(cond
@@ -10472,9 +10422,10 @@ reduces them without incurring seq initialization"
10472
10422
(.map
10473
10423
(js-keys obj)
10474
10424
(fn [k]
10475
- (simple-map-entry
10425
+ (MapEntry.
10476
10426
(cond-> k (some? (.match k #"^[A-Za-z_\*\+\? !\- '][\w\*\+\? !\- ']*$" )) keyword)
10477
- (unchecked-get obj k))))
10427
+ (unchecked-get obj k)
10428
+ nil )))
10478
10429
pr-writer writer opts))
10479
10430
10480
10431
(array? obj)
@@ -10655,10 +10606,10 @@ reduces them without incurring seq initialization"
10655
10606
(when (or (keyword? k) (symbol? k))
10656
10607
(if ns
10657
10608
(when (= ns (namespace k))
10658
- (.push lm (simple-map-entry (strip-ns k) v))
10609
+ (.push lm (MapEntry. (strip-ns k) v nil ))
10659
10610
(recur ns entries))
10660
10611
(when-let [new-ns (namespace k)]
10661
- (.push lm (simple-map-entry (strip-ns k) v))
10612
+ (.push lm (MapEntry. (strip-ns k) v nil ))
10662
10613
(recur new-ns entries))))
10663
10614
#js [ns lm])))))
10664
10615
@@ -12566,7 +12517,7 @@ reduces them without incurring seq initialization"
12566
12517
(next [_]
12567
12518
(let [k (aget strkeys i)]
12568
12519
(set! i (inc i))
12569
- (simple-map-entry (obj-map-key->keyword k) (unchecked-get strobj k)))))
12520
+ (MapEntry. (obj-map-key->keyword k) (unchecked-get strobj k) nil ))))
12570
12521
12571
12522
(deftype ObjMap [meta strkeys strobj ^:mutable __hash]
12572
12523
Object
@@ -12621,7 +12572,7 @@ reduces them without incurring seq initialization"
12621
12572
(when (pos? (alength strkeys))
12622
12573
(prim-seq
12623
12574
(.map (.sort strkeys obj-map-compare-keys)
12624
- #(simple-map-entry (obj-map-key->keyword %) (unchecked-get strobj %))))))
12575
+ #(MapEntry. (obj-map-key->keyword %) (unchecked-get strobj %) nil )))))
12625
12576
12626
12577
ICounted
12627
12578
(-count [coll] (alength strkeys))
@@ -12822,7 +12773,7 @@ reduces them without incurring seq initialization"
12822
12773
(loop [j 0 ]
12823
12774
(when (< j len)
12824
12775
(do
12825
- (.push arr (simple-map-entry (aget bckt j) (aget bckt (inc j))))
12776
+ (.push arr (MapEntry. (aget bckt j) (aget bckt (inc j)) nil ))
12826
12777
(recur (+ j 2 )))))
12827
12778
(recur (inc i)))
12828
12779
(prim-seq arr))))))
0 commit comments