Skip to content

Commit

Permalink
refactor: simplify loop
Browse files Browse the repository at this point in the history
  • Loading branch information
aoles committed Feb 26, 2024
1 parent 0b20413 commit d617d7d
Showing 1 changed file with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,21 +447,8 @@ private void addBufferedWayGeometry(List<Coordinate> points, double bufferSize,
if(pl.isEmpty()){
return;
}
int size = pl.size();
double lat0 = pl.getLat(0);
double lon0 = pl.getLon(0);
double lat1;
double lon1;
for (int i = 1; i < size; ++i) {
lat1 = pl.getLat(i);
lon1 = pl.getLon(i);

addPoint(points, lon0, lat0);
if (i == size - 1)
addPoint(points, lon1, lat1);

lon0 = lon1;
lat0 = lat1;
for (int i = 0; i < pl.size(); ++i) {
addPoint(points, pl.getLon(i), pl.getLat(i));
}
}

Expand Down

0 comments on commit d617d7d

Please sign in to comment.