Skip to content

Commit 51c6d7a

Browse files
borkdudestuarthalloway
authored andcommitted
CLJ-2572 avoid reflection in clojure.data
Signed-off-by: Stuart Halloway <[email protected]>
1 parent 276fbfd commit 51c6d7a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/clj/clojure/data.clj

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
clojure.data
1313
(:require [clojure.set :as set]))
1414

15+
(set! *warn-on-reflection* true)
16+
1517
(declare diff)
1618

1719
(defn- atom-diff
@@ -78,9 +80,11 @@
7880

7981
(extend Object
8082
Diff
81-
{:diff-similar (fn [a b] ((if (.. a getClass isArray) diff-sequential atom-diff) a b))}
83+
{:diff-similar (fn [^Object a b]
84+
((if (.. a getClass isArray) diff-sequential atom-diff) a b))}
8285
EqualityPartition
83-
{:equality-partition (fn [x] (if (.. x getClass isArray) :sequential :atom))})
86+
{:equality-partition (fn [^Object x]
87+
(if (.. x getClass isArray) :sequential :atom))})
8488

8589
(extend-protocol EqualityPartition
8690
nil

0 commit comments

Comments
 (0)