Optimise R-tree queries in the case if there is no need to limit maximum number of results
This commit is contained in:
parent
717407e470
commit
36c074ca60
@ -90,11 +90,9 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
|||||||
auto phantom_nodes = MakePhantomNodes(input_coordinate, results);
|
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
|
// but we may rely on it somewhere
|
||||||
std::sort(phantom_nodes.begin(), phantom_nodes.end(), [](const auto &lhs,
|
std::sort(phantom_nodes.begin(),
|
||||||
const auto &rhs)
|
phantom_nodes.end(),
|
||||||
{
|
[](const auto &lhs, const auto &rhs) { return lhs.distance < rhs.distance; });
|
||||||
return lhs.distance < rhs.distance;
|
|
||||||
});
|
|
||||||
return phantom_nodes;
|
return phantom_nodes;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user