mirror of
https://github.com/penpot/penpot.git
synced 2026-09-14 16:09:01 +00:00
⚡ 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:
parent
64accaa842
commit
d8c1425daf
@ -118,7 +118,7 @@
|
|||||||
;; Cast a ray from the point in any direction and count the intersections
|
;; Cast a ray from the point in any direction and count the intersections
|
||||||
;; if it's odd the point is inside the polygon
|
;; if it's odd the point is inside the polygon
|
||||||
(->> lines
|
(->> lines
|
||||||
(filter #(intersect-ray? p %))
|
(filterv #(intersect-ray? p %))
|
||||||
(count)
|
(count)
|
||||||
(odd?)))
|
(odd?)))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user