mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
♻️ Do a small performance refactor
This commit is contained in:
parent
a4bbfe3c79
commit
1af4325e8f
1 changed files with 8 additions and 8 deletions
|
@ -347,14 +347,14 @@
|
|||
in the map nor in the objects tree."
|
||||
[interactions ids-map objects]
|
||||
(when (some? interactions)
|
||||
(->> interactions
|
||||
(filterv (fn [interaction]
|
||||
(let [destination (:destination interaction)]
|
||||
(or (nil? destination)
|
||||
(contains? ids-map destination)
|
||||
(contains? objects destination)))))
|
||||
(mapv (fn [interaction]
|
||||
(d/update-when interaction :destination #(get ids-map % %)))))))
|
||||
(let [xform (comp (filter (fn [interaction]
|
||||
(let [destination (:destination interaction)]
|
||||
(or (nil? destination)
|
||||
(contains? ids-map destination)
|
||||
(contains? objects destination)))))
|
||||
(map (fn [interaction]
|
||||
(d/update-when interaction :destination #(get ids-map % %)))))]
|
||||
(into [] xform interactions))))
|
||||
|
||||
(defn actionable?
|
||||
"Check if there is any interaction that is clickable by the user"
|
||||
|
|
Loading…
Reference in a new issue