Fix behaviour of table if sources/destinations arrays are empty
This commit is contained in:
@@ -59,19 +59,7 @@ Status TablePlugin::HandleRequest(const api::TableParameters ¶ms, 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())
|
||||
{
|
||||
|
||||
@@ -186,7 +186,7 @@ Status TripPlugin::HandleRequest(const api::TripParameters ¶meters,
|
||||
|
||||
// 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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user