0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-04 21:38:53 -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? (defn is-direct-child-of-root?
([objects id] ([objects id]
(is-direct-child-of-root? (get objects id))) (is-direct-child-of-root? (get objects id)))
([{:keys [frame-id type]}] ([shape]
(and (= type :frame) (and (some? shape)
(= frame-id uuid/zero)))) (= (dm/get-prop shape :type) :frame)
(= (dm/get-prop shape :frame-id) uuid/zero))))
(defn frame-shape? (defn frame-shape?
([objects id] ([objects id]