Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Remove redundant check in scanLine
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoabinader committed Jul 10, 2018
1 parent f629012 commit e5491d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/mbgl/util/tile_cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ std::vector<UnwrappedTileID> tileCover(Point<double> tl,
}

auto scanLine = [&](int32_t x0, int32_t x1, int32_t y) {
int32_t x;
if (y >= 0 && y <= tiles) {
for (x = x0; x < x1; ++x) {
const auto dx = x + 0.5 - c.x, dy = y + 0.5 - c.y;
t.emplace_back(ID{ x, y, dx * dx + dy * dy });
}
double dx, dy;
for (int32_t x = x0; x < x1; ++x) {
// We don't know which corner of the tile coordinate is the closest,
// so add 0.5 to calculate the distance from its own center.
dx = x + 0.5 - c.x; dy = y + 0.5 - c.y;
t.emplace_back(ID{ x, y, dx * dx + dy * dy });
}
};

Expand Down

0 comments on commit e5491d8

Please sign in to comment.