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

Add micro optimization to cph/root? predicate

accessing directly to the prop instead of using
the lookup operation
This commit is contained in:
Andrey Antukh 2023-06-20 11:46:29 +02:00
parent 8d46271e9d
commit 4a4423da70

View file

@ -22,8 +22,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn root? (defn root?
[{:keys [id type]}] [shape]
(and (= type :frame) (= id uuid/zero))) (and (= (dm/get-prop shape :type) :frame)
(= (dm/get-prop shape :id) uuid/zero)))
(defn root-frame? (defn root-frame?
([objects id] ([objects id]