[core] Use std::tie in tileCover sort

This commit is contained in:
Bruno de Oliveira Abinader
2017-01-17 11:57:27 +01:00
parent 8847192694
commit 4439aecbcc

View File

@@ -109,8 +109,7 @@ std::vector<UnwrappedTileID> tileCover(const Point<double>& tl,
// Sort first by distance, then by x/y.
std::sort(t.begin(), t.end(), [](const ID& a, const ID& b) {
return (a.sqDist != b.sqDist) ? (a.sqDist < b.sqDist)
: ((a.x != b.x) ? (a.x < b.x) : (a.y < b.y));
return std::tie(a.sqDist, a.x, a.y) < std::tie(b.sqDist, b.x, b.y);
});
// Erase duplicate tile IDs (they typically occur at the common side of both triangles).