diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2019-02-19 18:23:58 +0300 |
---|---|---|
committer | Vlad Mihaylenko <vxmihaylenko@gmail.com> | 2019-02-20 13:25:42 +0300 |
commit | c3b96202545247ca41c144ac67907d5f60d4e6a8 (patch) | |
tree | 6b581e8e60bc04a9dfe1604ec24934597931aadb /routing | |
parent | da102aef071b7e98a13fad451d214c1d8765460a (diff) |
Review fixes.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/index_router.cpp | 2 | ||||
-rw-r--r-- | routing/routing_integration_tests/route_test.cpp | 7 | ||||
-rw-r--r-- | routing/speed_camera_prohibition.cpp | 11 |
3 files changed, 7 insertions, 13 deletions
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<Segment> const & segments, set<NumMwmId> 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<VehicleType::Car>(), 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 <algorithm> #include <vector> namespace @@ -18,13 +19,9 @@ std::vector<std::string> kSpeedCamerasPartlyProhibitedCountries = { bool IsMwmContained(platform::CountryFile const & mwm, std::vector<std::string> 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 |