Skip to content

Commit

Permalink
perf: removed duplicate calculations from polygon _set_points
Browse files Browse the repository at this point in the history
  • Loading branch information
eladyaniv01 committed Sep 6, 2020
1 parent 63b91f5 commit 948edeb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions MapAnalyzer/Polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ def __init__(self, map_data: "MapData", array: ndarray) -> None: # pragma: no c
self._buildables = Buildables(polygon=self)

def _set_points(self):

self.points = set([Point2((int(p[0]), int(p[1]))) for p in self._clean_points])
self.points = set([Point2(p) for p in self._clean_points])
points = [p for p in self.map_data.indices_to_points(self.indices)]
points = [p for p in self._clean_points]
points.extend(self.corner_points)
points.extend(self.perimeter_points)
self.points = set([Point2((int(p[0]), int(p[1]))) for p in points])
Expand Down

0 comments on commit 948edeb

Please sign in to comment.