Make copying of watches in ratom a little faster

This commit is contained in:
Dan Holmsand 2015-10-09 14:41:03 +02:00
parent 88d961563a
commit d30ef3aedb
1 changed files with 2 additions and 1 deletions

View File

@ -74,7 +74,8 @@
(let [w (.-watchesArr this)
a (if (nil? w)
;; Copy watches to array for speed
(->> this .-watches seq flatten into-array
(->> (.-watches this)
(reduce-kv #(doto %1 (.push %2) (.push %3)) #js[])
(set! (.-watchesArr this)))
w)]
(let [len (alength a)]