From a82ee01d997d657fa57b86ff824d5b1861d16341 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 25 Aug 2023 12:27:00 +0200 Subject: [PATCH] :sparkles: Add minor improvement to points->lines helper --- common/src/app/common/geom/shapes/intersect.cljc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/src/app/common/geom/shapes/intersect.cljc b/common/src/app/common/geom/shapes/intersect.cljc index 343855ef01..b32196f44b 100644 --- a/common/src/app/common/geom/shapes/intersect.cljc +++ b/common/src/app/common/geom/shapes/intersect.cljc @@ -73,12 +73,10 @@ (points->lines points true)) ([points closed?] - (map vector - points - (-> (rest points) - (vec) - (cond-> closed? - (conj (first points))))))) + (map vector points + (cond-> (rest points) + (true? closed?) + (concat (list (first points))))))) (defn intersects-lines? "Checks if two sets of lines intersect in any point"