Make should-component-update a little faster for :style attrs

This commit is contained in:
Dan Holmsand 2014-01-29 11:40:07 +01:00
parent b45a215f52
commit 344e9e5db5

View File

@ -56,12 +56,12 @@
(reduce-kv (fn [res k v] (reduce-kv (fn [res k v]
(let [yv (get y k -not-found)] (let [yv (get y k -not-found)]
(if (or (keyword-identical? v yv) (if (or (keyword-identical? v yv)
;; hack to allow reagent.core/partial and :style ;; Allow :style maps and reagent/partial
;; maps to be compared with = ;; and :style maps to be compared properly
(and (or (and (keyword-identical? k :style)
(keyword-identical? k :style) (shallow-equal-maps v yv))
(identical? (type v) partial-ifn)) (and (identical? (type v) partial-ifn)
(= v yv))) (= y yv)))
res res
(reduced false)))) (reduced false))))
true x)))) true x))))