Skip to content

Commit

Permalink
refactor(geometry): use list comprehension in "PointList2D.__init__"
Browse files Browse the repository at this point in the history
PR Closed: #841
  • Loading branch information
linjiX committed Jul 20, 2021
1 parent 99d794b commit d054bb4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tensorbay/geometry/point_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ def __init__(
self,
points: Optional[Iterable[Iterable[float]]] = None,
) -> None:
self._data = []
if points is None:
return

for point in points:
self._data.append(self._ElementType(*point))
self._data = [self._ElementType(*point) for point in points] if points else []

def _loads(self: _P, contents: List[Dict[str, float]]) -> None:
self._data = []
Expand Down

0 comments on commit d054bb4

Please sign in to comment.