Skip to content

Commit

Permalink
CLJ-2362 withMeta() should return identical object on same meta
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Aug 23, 2024
1 parent 818bfdc commit 931535b
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/com/ambrosebs/map.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,10 @@
(or (nil? s)
(seq? s))]}
(proxy [clojure.lang.ASeq] [meta]
(withMeta [meta]
(nodeSeq-ctor meta array i s))
(withMeta [new-meta]
(if (identical? meta new-meta)
this
(nodeSeq-ctor new-meta array i s)))
(first []
;(pprint array)
;(prn i)
Expand Down Expand Up @@ -1365,9 +1367,11 @@

(defn array-nodeSeq-ctor [meta nodes i s]
(proxy [clojure.lang.ASeq] [meta]
(withMeta [meta]
(array-nodeSeq-ctor
meta nodes i s))
(withMeta [new-meta]
(if (identical? new-meta meta)
this
(array-nodeSeq-ctor
meta nodes i s)))
(first []
(first s))
(next []
Expand Down Expand Up @@ -1814,12 +1818,14 @@

clojure.lang.IObj
(withMeta [this meta]
(hash-map-ctor
meta
count
root
has-null
null-value))
(if (identical? _meta meta)
this
(hash-map-ctor
meta
count
root
has-null
null-value)))

clojure.lang.IEditableCollection
(asTransient [this]
Expand Down

0 comments on commit 931535b

Please sign in to comment.