From 4a4423da7057f3f35cee1997844a7643db571522 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 20 Jun 2023 11:46:29 +0200 Subject: [PATCH] :zap: Add micro optimization to cph/root? predicate accessing directly to the prop instead of using the lookup operation --- common/src/app/common/pages/helpers.cljc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/pages/helpers.cljc b/common/src/app/common/pages/helpers.cljc index 71df27d7bd..299fd26243 100644 --- a/common/src/app/common/pages/helpers.cljc +++ b/common/src/app/common/pages/helpers.cljc @@ -22,8 +22,9 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn root? - [{:keys [id type]}] - (and (= type :frame) (= id uuid/zero))) + [shape] + (and (= (dm/get-prop shape :type) :frame) + (= (dm/get-prop shape :id) uuid/zero))) (defn root-frame? ([objects id]