0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 16:39:49 -05:00

Add micro optimization to is-direct-child-of-root? helper

This commit is contained in:
Andrey Antukh 2023-08-28 15:56:41 +02:00
parent 58f788455f
commit 82f1b96503

View file

@ -29,9 +29,10 @@
(defn is-direct-child-of-root?
([objects id]
(is-direct-child-of-root? (get objects id)))
([{:keys [frame-id type]}]
(and (= type :frame)
(= frame-id uuid/zero))))
([shape]
(and (some? shape)
(= (dm/get-prop shape :type) :frame)
(= (dm/get-prop shape :frame-id) uuid/zero))))
(defn frame-shape?
([objects id]