diff --git a/include/engine/geospatial_query.hpp b/include/engine/geospatial_query.hpp index e7d74c53b..a80ef2060 100644 --- a/include/engine/geospatial_query.hpp +++ b/include/engine/geospatial_query.hpp @@ -82,7 +82,7 @@ template class GeospatialQuery std::vector NearestPhantomNodes(const util::Coordinate input_coordinate, const Approach approach, - const boost::optional max_results, + const size_t max_results, const boost::optional max_distance, const boost::optional bearing_with_range, const boost::optional use_all_edges) const @@ -100,10 +100,10 @@ template class GeospatialQuery : std::make_pair(true, true)); return valid; }, - [this, &max_distance, &max_results, input_coordinate](const std::size_t num_results, - const CandidateSegment &segment) + [this, &max_distance, max_results, input_coordinate](const std::size_t num_results, + const CandidateSegment &segment) { - return (max_results && num_results >= *max_results) || + return (num_results >= max_results) || (max_distance && max_distance != -1.0 && CheckSegmentDistance(input_coordinate, segment, *max_distance)); });