Fix behaviour of table if sources/destinations arrays are empty

This commit is contained in:
Patrick Niklaus
2016-02-25 00:27:14 +01:00
parent 0d38a50dba
commit 51e8318224
3 changed files with 37 additions and 91 deletions
+1 -13
View File
@@ -59,19 +59,7 @@ Status TablePlugin::HandleRequest(const api::TableParameters &params, util::json
}
auto snapped_phantoms = SnapPhantomNodes(GetPhantomNodes(params));
const auto result_table = [&]
{
if (params.sources.empty())
{
BOOST_ASSERT(params.destinations.empty());
return distance_table(snapped_phantoms);
}
else
{
return distance_table(snapped_phantoms, params.sources, params.destinations);
}
}();
auto result_table = distance_table(snapped_phantoms, params.sources, params.destinations);
if (result_table.empty())
{
+1 -1
View File
@@ -186,7 +186,7 @@ Status TripPlugin::HandleRequest(const api::TripParameters &parameters,
// compute the duration table of all phantom nodes
const auto result_table = util::DistTableWrapper<EdgeWeight>(
duration_table(snapped_phantoms), number_of_locations);
duration_table(snapped_phantoms, {}, {}), number_of_locations);
if (result_table.size() == 0)
{