Skip to content

Commit c81817a

Browse files
committed
avoid full blown map entry
1 parent 9a2c2e8 commit c81817a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10383,7 +10383,7 @@ reduces them without incurring seq initialization"
1038310383
(implements? IMeta obj)
1038410384
(not (nil? (meta obj)))))
1038510385

10386-
(defn- pr-map-entry [k v]
10386+
(defn- simple-map-entry [k v]
1038710387
(reify
1038810388
IMapEntry
1038910389
(-key [_] k)
@@ -10429,7 +10429,7 @@ reduces them without incurring seq initialization"
1042910429
(.map
1043010430
(js-keys obj)
1043110431
(fn [k]
10432-
(pr-map-entry
10432+
(simple-map-entry
1043310433
(cond-> k (some? (.match k #"^[A-Za-z_\*\+\?!\-'][\w\*\+\?!\-']*$")) keyword)
1043410434
(unchecked-get obj k))))
1043510435
pr-writer writer opts))
@@ -10610,10 +10610,10 @@ reduces them without incurring seq initialization"
1061010610
(when (or (keyword? k) (symbol? k))
1061110611
(if ns
1061210612
(when (= ns (namespace k))
10613-
(.push lm (pr-map-entry (strip-ns k) v))
10613+
(.push lm (simple-map-entry (strip-ns k) v))
1061410614
(recur ns entries))
1061510615
(when-let [new-ns (namespace k)]
10616-
(.push lm (pr-map-entry (strip-ns k) v))
10616+
(.push lm (simple-map-entry (strip-ns k) v))
1061710617
(recur new-ns entries))))
1061810618
#js [ns lm])))))
1061910619

@@ -12414,7 +12414,7 @@ reduces them without incurring seq initialization"
1241412414
(when (pos? (alength keys))
1241512415
(prim-seq
1241612416
(.map (.sort keys obj-map-compare-keys)
12417-
#(MapEntry. % (unchecked-get strobj %))))))
12417+
#(simple-map-entry % (unchecked-get strobj %))))))
1241812418

1241912419
ICounted
1242012420
(-count [coll] (alength keys))
@@ -12562,7 +12562,7 @@ reduces them without incurring seq initialization"
1256212562
(loop [j 0]
1256312563
(when (< j len)
1256412564
(do
12565-
(.push arr (MapEntry. (aget bckt j) (aget bckt (inc j)) nil))
12565+
(.push arr (simple-map-entry (aget bckt j) (aget bckt (inc j)) nil))
1256612566
(recur (+ j 2)))))
1256712567
(recur (inc i)))
1256812568
(prim-seq arr))))))

0 commit comments

Comments
 (0)