Add minor perfromance improvement to is-point-inside-evenodd fn

Replace filter with filterv for avoid an other iteration on the
following count operation
This commit is contained in:
Andrey Antukh 2023-08-25 10:22:39 +02:00 committed by Andrés Moya
parent 64accaa842
commit d8c1425daf

View File

@ -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?)))