diff --git a/src/mbgl/util/tile_cover.cpp b/src/mbgl/util/tile_cover.cpp index 2fb7371ab..769973958 100644 --- a/src/mbgl/util/tile_cover.cpp +++ b/src/mbgl/util/tile_cover.cpp @@ -109,8 +109,7 @@ std::vector tileCover(const Point& 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).