From 0a0ebc1934b10476efa84e7dd71639fe75bba727 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 15 May 2024 17:41:50 +0200 Subject: [PATCH] Remove sorting --- include/engine/geospatial_query.hpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/engine/geospatial_query.hpp b/include/engine/geospatial_query.hpp index c3843e8eb..e7d74c53b 100644 --- a/include/engine/geospatial_query.hpp +++ b/include/engine/geospatial_query.hpp @@ -74,13 +74,7 @@ template class GeospatialQuery : std::make_pair(true, true)); return valid; }); - auto phantom_nodes = MakePhantomNodes(input_coordinate, results); - // there is no guarantee that `SearchInRange` will return results sorted by distance, - // but we may rely on it somewhere - std::sort(phantom_nodes.begin(), - phantom_nodes.end(), - [](const auto &lhs, const auto &rhs) { return lhs.distance < rhs.distance; }); - return phantom_nodes; + return MakePhantomNodes(input_coordinate, results); } // Returns max_results nearest PhantomNodes that are valid within the provided parameters.