Skip to content

Commit

Permalink
Update polygon.cr
Browse files Browse the repository at this point in the history
  • Loading branch information
mamantoha committed Mar 29, 2024
1 parent e5a79b4 commit 5fe6e6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/geo/polygon.cr
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ module Geo
def contains?(coord : Geo::Coord) : Bool
last_coord = @coords.last
odd_nodes = false
x = coord.lng
y = coord.lat
y, x = coord.ll

@coords.each do |iter_coord|
yi, xi = iter_coord.ll
Expand Down Expand Up @@ -91,6 +90,7 @@ module Geo

def ==(other : Geo::Polygon) : Bool
min_size = Math.min(size, other.size)

0.upto(min_size - 1) do |i|
return false unless self[i] == other[i]
end
Expand Down

0 comments on commit 5fe6e6f

Please sign in to comment.