diff --git a/routing/index_router.cpp b/routing/index_router.cpp index a1f2906273..4e005979a6 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -1036,7 +1036,7 @@ void IndexRouter::FillSpeedCamProhibitedMwms(vector const & segments, set mwmIds; for (auto const & s : segments) - mwmIds.insert(s.GetMwmId()); + mwmIds.emplace(s.GetMwmId()); for (auto const id : mwmIds) { diff --git a/routing/routing_integration_tests/route_test.cpp b/routing/routing_integration_tests/route_test.cpp index 0bd7a54e92..845e5a9a67 100644 --- a/routing/routing_integration_tests/route_test.cpp +++ b/routing/routing_integration_tests/route_test.cpp @@ -428,14 +428,14 @@ namespace integration::TestRouteTime(route, 7136.04); } - // Test on removing speed cameras form the route for maps from Jan 2019, + // Test on removing speed cameras from the route for maps from Jan 2019, // and on the absence of speed cameras in maps for later maps for Switzerland. UNIT_TEST(SwitzerlandNoSpeedCamerasInRouteTest) { TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(), MercatorBounds::FromLatLon(47.5194, 8.73093), {0., 0.}, - MercatorBounds::FromLatLon(52.6756, 13.2745)); + MercatorBounds::FromLatLon(46.80592, 7.13724)); RouterResultCode const result = routeResult.second; TEST_EQUAL(result, RouterResultCode::NoError, ()); @@ -445,9 +445,6 @@ namespace auto const & routeSegments = route.GetRouteSegments(); for (auto const & routeSegment : routeSegments) { - if (!routeSegment.GetSpeedCams().empty()) - continue; - TEST(routeSegment.GetSpeedCams().empty(), (routeSegment.GetSegment(), routeSegment.GetStreet())); } diff --git a/routing/speed_camera_prohibition.cpp b/routing/speed_camera_prohibition.cpp index 1ae4441c16..bf3f26df0c 100644 --- a/routing/speed_camera_prohibition.cpp +++ b/routing/speed_camera_prohibition.cpp @@ -2,6 +2,7 @@ #include "base/string_utils.hpp" +#include #include namespace @@ -18,13 +19,9 @@ std::vector kSpeedCamerasPartlyProhibitedCountries = { bool IsMwmContained(platform::CountryFile const & mwm, std::vector const & countryList) { - for (auto const & country : countryList) - { - if (strings::StartsWith(mwm.GetName(), country)) - return true; - } - - return false; + return std::any_of(countryList.cbegin(), countryList.cend(), [&mwm](auto const & country) { + return strings::StartsWith(mwm.GetName(), country); + }); } } // namespace