diff options
-rw-r--r-- | src/clj/clojure/data.clj | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/clj/clojure/data.clj b/src/clj/clojure/data.clj index 15878962..6e8dbcf2 100644 --- a/src/clj/clojure/data.clj +++ b/src/clj/clojure/data.clj @@ -106,6 +106,7 @@ [things-only-in-a things-only-in-b things-in-both]. Comparison rules: + * For equal a and b, return [nil nil a]. * Maps are subdiffed where keys match and values differ. * Sets are never subdiffed. * All sequential things are treated as associative collections @@ -114,7 +115,9 @@ an atom and compared for equality." {:added "1.3"} [a b] - (if (= (equality-partition a) (equality-partition b)) - (diff-similar a b) - (atom-diff a b))) + (if (= a b) + [nil nil a] + (if (= (equality-partition a) (equality-partition b)) + (diff-similar a b) + (atom-diff a b)))) |