From 98ea2a0b09d487674b67ad3336caf56d40871956 Mon Sep 17 00:00:00 2001 From: Kajari Ghosh Date: Tue, 4 Dec 2018 13:35:26 -0500 Subject: [PATCH] remove destination/sources length <= coordinates length check (#5289) --- CHANGELOG.md | 1 + include/engine/api/table_parameters.hpp | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 549333c90f6..116e5738e81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Table: - CHANGED: switch to pre-calculated distances for table responses for large speedup and 10% memory increase. [#5251](https://github.com/Project-OSRM/osrm-backend/pull/5251) - ADDED: new parameter `fallback_speed` which will fill `null` cells with estimated value [#5257](https://github.com/Project-OSRM/osrm-backend/pull/5257) + - CHANGED: Remove API check for matrix sources/destination length to be less than or equal to coordinates length. [#5298](https://github.com/Project-OSRM/osrm-backend/pull/5289) - Features: - ADDED: direct mmapping of datafiles is now supported via the `--mmap` switch. [#5242](https://github.com/Project-OSRM/osrm-backend/pull/5242) - REMOVED: the previous `--memory_file` switch is now deprecated and will fallback to `--mmap` [#5242](https://github.com/Project-OSRM/osrm-backend/pull/5242) diff --git a/include/engine/api/table_parameters.hpp b/include/engine/api/table_parameters.hpp index 243d9414231..1bf05ff6e0e 100644 --- a/include/engine/api/table_parameters.hpp +++ b/include/engine/api/table_parameters.hpp @@ -123,14 +123,7 @@ struct TableParameters : public BaseParameters // 1/ The user is able to specify duplicates in srcs and dsts, in that case it's their fault - // 2/ len(srcs) and len(dsts) smaller or equal to len(locations) - if (sources.size() > coordinates.size()) - return false; - - if (destinations.size() > coordinates.size()) - return false; - - // 3/ 0 <= index < len(locations) + // 2/ 0 <= index < len(locations) const auto not_in_range = [this](const std::size_t x) { return x >= coordinates.size(); }; if (std::any_of(begin(sources), end(sources), not_in_range))