Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

## Fixed

- Simplified internals when diffing maps for improved performance on many datasets.

## Changed

# 2.8.190 (2023-03-30 / 34d5e17)
Expand Down
12 changes: 1 addition & 11 deletions src/lambdaisland/deep_diff2/diff_impl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,10 @@
(map ->Insertion)
(remove #(contains? exp %) act)))

(let [exp {false 0, 0 0}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a stray top level form that probably should've been in a comment block. I just deleted it because it was a test of the impl below which is changing here and so it's no longer applicable.

act {false 0, 0 0}
exp-ks (keys exp)
act-ks (concat (filter #(contains? (set (keys act)) %) exp-ks)
(remove #(contains? (set exp-ks) %) (keys act)))
[del ins] (del+ins exp-ks act-ks)]
[del ins])
(del+ins [0 false] [0 false])

(defn diff-map [exp act]
(first
(let [exp-ks (keys exp)
act-ks (concat (filter #(contains? (set (keys act)) %) exp-ks)
(remove #(contains? (set exp-ks) %) (keys act)))
act-ks (keys act)
[del ins] (del+ins exp-ks act-ks)]
(reduce
(fn [[m idx] k]
Expand Down