0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-15 17:21:17 -05:00

Add minor performance improvement to get-viewer-frames

Reducing redundant lookups
This commit is contained in:
Andrey Antukh 2023-08-25 16:36:38 +02:00 committed by Andrés Moya
parent b7eb20dc44
commit 0d0c5ed96c

View file

@ -320,12 +320,12 @@
(get-viewer-frames objects nil))
([objects {:keys [all-frames?]}]
(into []
(comp (map (d/getf objects))
(if all-frames?
identity
(remove :hide-in-viewer)))
(sort-z-index objects (get-frames-ids objects)))))
(->> (get-frames objects)
(sort-z-index-objects objects)
(into []
(if all-frames?
(map identity)
(remove :hide-in-viewer))))))
(defn start-page-index
[objects]