From 4439aecbcc21aae8b71c9b9a0bd65d9d128d6c83 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 17 Jan 2017 11:57:27 +0100 Subject: [PATCH] [core] Use std::tie in tileCover sort --- src/mbgl/util/tile_cover.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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).