From 36c074ca6069a5c5e4bad44ad3ce1addd8be6123 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 12 May 2024 11:57:19 +0200 Subject: [PATCH] Optimise R-tree queries in the case if there is no need to limit maximum number of results --- include/engine/geospatial_query.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/engine/geospatial_query.hpp b/include/engine/geospatial_query.hpp index ae9ecc0ca..c7310f43a 100644 --- a/include/engine/geospatial_query.hpp +++ b/include/engine/geospatial_query.hpp @@ -88,13 +88,11 @@ template class GeospatialQuery return valid; }); auto phantom_nodes = MakePhantomNodes(input_coordinate, results); - // there is no guarantee that `SearchInRange` will return results sorted by distance, + // 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; - }); + std::sort(phantom_nodes.begin(), + phantom_nodes.end(), + [](const auto &lhs, const auto &rhs) { return lhs.distance < rhs.distance; }); return phantom_nodes; #endif }