Skip to content

Commit 0bb257c

Browse files
EwenGswannodette
authored andcommitted
CLJS-1884: Give a chance to MetaFn to be removed by closure under :advanced optimization Replace with-meta calls by -with-meta calls where possible
1 parent 314dd98 commit 0bb257c

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ reduces them without incurring seq initialization"
16371637
(cons o coll))
16381638

16391639
IEmptyableCollection
1640-
(-empty [coll] (with-meta (.-EMPTY List) meta))
1640+
(-empty [coll] (-with-meta (.-EMPTY List) meta))
16411641

16421642
IHash
16431643
(-hash [coll] (hash-ordered-coll coll))
@@ -3115,7 +3115,7 @@ reduces them without incurring seq initialization"
31153115
(-conj [coll o] (Cons. nil o coll nil))
31163116

31173117
IEmptyableCollection
3118-
(-empty [coll] (with-meta (.-EMPTY List) meta))
3118+
(-empty [coll] (-with-meta (.-EMPTY List) meta))
31193119

31203120
ISequential
31213121
IEquiv
@@ -3319,7 +3319,7 @@ reduces them without incurring seq initialization"
33193319
(-conj [coll o] (cons o coll))
33203320

33213321
IEmptyableCollection
3322-
(-empty [coll] (with-meta (.-EMPTY List) meta))
3322+
(-empty [coll] (-with-meta (.-EMPTY List) meta))
33233323

33243324
ISequential
33253325
IEquiv
@@ -3460,7 +3460,7 @@ reduces them without incurring seq initialization"
34603460
(cons o this))
34613461

34623462
IEmptyableCollection
3463-
(-empty [coll] (with-meta (.-EMPTY List) meta))
3463+
(-empty [coll] (-with-meta (.-EMPTY List) meta))
34643464

34653465
IHash
34663466
(-hash [coll] (caching-hash coll hash-ordered-coll __hash)))
@@ -4772,12 +4772,12 @@ reduces them without incurring seq initialization"
47724772
([to from]
47734773
(if-not (nil? to)
47744774
(if (implements? IEditableCollection to)
4775-
(with-meta (persistent! (reduce -conj! (transient to) from)) (meta to))
4775+
(-with-meta (persistent! (reduce -conj! (transient to) from)) (meta to))
47764776
(reduce -conj to from))
47774777
(reduce conj () from)))
47784778
([to xform from]
47794779
(if (implements? IEditableCollection to)
4780-
(with-meta (persistent! (transduce xform conj! (transient to) from)) (meta to))
4780+
(-with-meta (persistent! (transduce xform conj! (transient to) from)) (meta to))
47814781
(transduce xform conj to from))))
47824782

47834783
(defn mapv
@@ -5081,7 +5081,7 @@ reduces them without incurring seq initialization"
50815081
(PersistentVector. meta (inc cnt) new-shift new-root (array o) nil))))
50825082

50835083
IEmptyableCollection
5084-
(-empty [coll] (with-meta (.-EMPTY PersistentVector) meta))
5084+
(-empty [coll] (-with-meta (.-EMPTY PersistentVector) meta))
50855085

50865086
ISequential
50875087
IEquiv
@@ -5312,7 +5312,7 @@ reduces them without incurring seq initialization"
53125312

53135313
IEmptyableCollection
53145314
(-empty [coll]
5315-
(with-meta (.-EMPTY PersistentVector) meta))
5315+
(-with-meta (.-EMPTY PersistentVector) meta))
53165316

53175317
IChunkedSeq
53185318
(-chunked-first [coll]
@@ -5386,7 +5386,7 @@ reduces them without incurring seq initialization"
53865386
(build-subvec meta (-assoc-n v end o) start (inc end) nil))
53875387

53885388
IEmptyableCollection
5389-
(-empty [coll] (with-meta (.-EMPTY PersistentVector) meta))
5389+
(-empty [coll] (-with-meta (.-EMPTY PersistentVector) meta))
53905390

53915391
ISequential
53925392
IEquiv
@@ -5732,7 +5732,7 @@ reduces them without incurring seq initialization"
57325732
(-conj [coll o] (cons o coll))
57335733

57345734
IEmptyableCollection
5735-
(-empty [coll] (with-meta (.-EMPTY List) meta))
5735+
(-empty [coll] (-with-meta (.-EMPTY List) meta))
57365736

57375737
ISequential
57385738
IEquiv
@@ -5794,7 +5794,7 @@ reduces them without incurring seq initialization"
57945794
(PersistentQueue. meta (inc count) (conj front o) [] nil)))
57955795

57965796
IEmptyableCollection
5797-
(-empty [coll] (with-meta (.-EMPTY PersistentQueue) meta))
5797+
(-empty [coll] (-with-meta (.-EMPTY PersistentQueue) meta))
57985798

57995799
ISequential
58005800
IEquiv
@@ -5870,7 +5870,7 @@ reduces them without incurring seq initialization"
58705870
(if (< i len)
58715871
(let [k (aget ks i)]
58725872
(recur (inc i) (assoc! out k (aget so k))))
5873-
(with-meta (persistent! (assoc! out k v)) mm)))))
5873+
(-with-meta (persistent! (assoc! out k v)) mm)))))
58745874

58755875
;;; ObjMap - DEPRECATED
58765876

@@ -5906,7 +5906,7 @@ reduces them without incurring seq initialization"
59065906
entry)))
59075907

59085908
IEmptyableCollection
5909-
(-empty [coll] (with-meta (.-EMPTY ObjMap) meta))
5909+
(-empty [coll] (-with-meta (.-EMPTY ObjMap) meta))
59105910

59115911
IEquiv
59125912
(-equiv [coll other] (equiv-map coll other))
@@ -6246,7 +6246,7 @@ reduces them without incurring seq initialization"
62466246
(cons o coll))
62476247

62486248
IEmptyableCollection
6249-
(-empty [coll] (with-meta (.-EMPTY List) _meta))
6249+
(-empty [coll] (-with-meta (.-EMPTY List) _meta))
62506250

62516251
IHash
62526252
(-hash [coll] (hash-ordered-coll coll))
@@ -7175,7 +7175,7 @@ reduces them without incurring seq initialization"
71757175
(-conj [coll o] (cons o coll))
71767176

71777177
IEmptyableCollection
7178-
(-empty [coll] (with-meta (.-EMPTY List) meta))
7178+
(-empty [coll] (-with-meta (.-EMPTY List) meta))
71797179

71807180
ISequential
71817181
ISeq
@@ -7247,7 +7247,7 @@ reduces them without incurring seq initialization"
72477247
(-conj [coll o] (cons o coll))
72487248

72497249
IEmptyableCollection
7250-
(-empty [coll] (with-meta (.-EMPTY List) meta))
7250+
(-empty [coll] (-with-meta (.-EMPTY List) meta))
72517251

72527252
ISequential
72537253
ISeq
@@ -7626,7 +7626,7 @@ reduces them without incurring seq initialization"
76267626
(-conj [coll o] (cons o coll))
76277627

76287628
IEmptyableCollection
7629-
(-empty [coll] (with-meta (.-EMPTY List) meta))
7629+
(-empty [coll] (-with-meta (.-EMPTY List) meta))
76307630

76317631
IHash
76327632
(-hash [coll] (caching-hash coll hash-ordered-coll __hash))
@@ -7804,7 +7804,7 @@ reduces them without incurring seq initialization"
78047804

78057805
IWithMeta
78067806
(-with-meta [node meta]
7807-
(with-meta [key val] meta))
7807+
(-with-meta [key val] meta))
78087808

78097809
IStack
78107810
(-peek [node] val)
@@ -7965,7 +7965,7 @@ reduces them without incurring seq initialization"
79657965

79667966
IWithMeta
79677967
(-with-meta [node meta]
7968-
(with-meta [key val] meta))
7968+
(-with-meta [key val] meta))
79697969

79707970
IStack
79717971
(-peek [node] val)
@@ -8377,7 +8377,7 @@ reduces them without incurring seq initialization"
83778377
(cons o coll))
83788378

83798379
IEmptyableCollection
8380-
(-empty [coll] (with-meta (.-EMPTY List) _meta))
8380+
(-empty [coll] (-with-meta (.-EMPTY List) _meta))
83818381

83828382
IHash
83838383
(-hash [coll] (hash-ordered-coll coll))
@@ -8453,7 +8453,7 @@ reduces them without incurring seq initialization"
84538453
(cons o coll))
84548454

84558455
IEmptyableCollection
8456-
(-empty [coll] (with-meta (.-EMPTY List) _meta))
8456+
(-empty [coll] (-with-meta (.-EMPTY List) _meta))
84578457

84588458
IHash
84598459
(-hash [coll] (hash-ordered-coll coll))
@@ -8532,7 +8532,7 @@ reduces them without incurring seq initialization"
85328532
(assoc ret key entry)
85338533
ret)
85348534
(next keys)))
8535-
(with-meta ret (meta map)))))
8535+
(-with-meta ret (meta map)))))
85368536

85378537
;;; PersistentHashSet
85388538

@@ -8586,7 +8586,7 @@ reduces them without incurring seq initialization"
85868586
(PersistentHashSet. meta (assoc hash-map o nil) nil))
85878587

85888588
IEmptyableCollection
8589-
(-empty [coll] (with-meta (.-EMPTY PersistentHashSet) meta))
8589+
(-empty [coll] (-with-meta (.-EMPTY PersistentHashSet) meta))
85908590

85918591
IEquiv
85928592
(-equiv [coll other]
@@ -9084,7 +9084,7 @@ reduces them without incurring seq initialization"
90849084
(-conj [rng o] (cons o rng))
90859085

90869086
IEmptyableCollection
9087-
(-empty [rng] (with-meta (.-EMPTY List) meta))
9087+
(-empty [rng] (-with-meta (.-EMPTY List) meta))
90889088

90899089
ISequential
90909090
IEquiv

0 commit comments

Comments
 (0)