From d8c1425dafeef9153c1364e56428eeeb0de30bb2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 25 Aug 2023 10:22:39 +0200 Subject: [PATCH] :zap: Add minor perfromance improvement to is-point-inside-evenodd fn Replace filter with filterv for avoid an other iteration on the following count operation --- common/src/app/common/geom/shapes/intersect.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/app/common/geom/shapes/intersect.cljc b/common/src/app/common/geom/shapes/intersect.cljc index e2810e61e7..1d636ddcec 100644 --- a/common/src/app/common/geom/shapes/intersect.cljc +++ b/common/src/app/common/geom/shapes/intersect.cljc @@ -118,7 +118,7 @@ ;; Cast a ray from the point in any direction and count the intersections ;; if it's odd the point is inside the polygon (->> lines - (filter #(intersect-ray? p %)) + (filterv #(intersect-ray? p %)) (count) (odd?)))