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.