Refactor CustomizeCell::RelaxNode to move level check inside function
This commit is contained in:
parent
27324d0270
commit
00e243b23b
@ -68,12 +68,7 @@ class CellCustomizer
|
|||||||
const EdgeWeight weight = heap.GetKey(node);
|
const EdgeWeight weight = heap.GetKey(node);
|
||||||
const EdgeDuration duration = heap.GetData(node).duration;
|
const EdgeDuration duration = heap.GetData(node).duration;
|
||||||
|
|
||||||
if (level == 1)
|
RelaxNode(graph, cells, allowed_nodes, metric, heap, level, node, weight, duration);
|
||||||
RelaxNode<true>(
|
|
||||||
graph, cells, allowed_nodes, metric, heap, level, node, weight, duration);
|
|
||||||
else
|
|
||||||
RelaxNode<false>(
|
|
||||||
graph, cells, allowed_nodes, metric, heap, level, node, weight, duration);
|
|
||||||
|
|
||||||
destinations_set.erase(node);
|
destinations_set.erase(node);
|
||||||
}
|
}
|
||||||
@ -123,7 +118,7 @@ class CellCustomizer
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <bool first_level, typename GraphT>
|
template <typename GraphT>
|
||||||
void RelaxNode(const GraphT &graph,
|
void RelaxNode(const GraphT &graph,
|
||||||
const partition::CellStorage &cells,
|
const partition::CellStorage &cells,
|
||||||
const std::vector<bool> &allowed_nodes,
|
const std::vector<bool> &allowed_nodes,
|
||||||
@ -134,6 +129,7 @@ class CellCustomizer
|
|||||||
EdgeWeight weight,
|
EdgeWeight weight,
|
||||||
EdgeDuration duration) const
|
EdgeDuration duration) const
|
||||||
{
|
{
|
||||||
|
auto first_level = level == 1;
|
||||||
BOOST_ASSERT(heap.WasInserted(node));
|
BOOST_ASSERT(heap.WasInserted(node));
|
||||||
|
|
||||||
if (!first_level)
|
if (!first_level)
|
||||||
|
Loading…
Reference in New Issue
Block a user