From 00e243b23bb382e3c866a32732ee6720a23c4a65 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Fri, 18 Aug 2017 21:46:38 +0000 Subject: [PATCH] Refactor CustomizeCell::RelaxNode to move level check inside function --- include/customizer/cell_customizer.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/customizer/cell_customizer.hpp b/include/customizer/cell_customizer.hpp index d8375f5fa..2b0b840b1 100644 --- a/include/customizer/cell_customizer.hpp +++ b/include/customizer/cell_customizer.hpp @@ -68,12 +68,7 @@ class CellCustomizer const EdgeWeight weight = heap.GetKey(node); const EdgeDuration duration = heap.GetData(node).duration; - if (level == 1) - RelaxNode( - graph, cells, allowed_nodes, metric, heap, level, node, weight, duration); - else - RelaxNode( - graph, cells, allowed_nodes, metric, heap, level, node, weight, duration); + RelaxNode(graph, cells, allowed_nodes, metric, heap, level, node, weight, duration); destinations_set.erase(node); } @@ -123,7 +118,7 @@ class CellCustomizer } private: - template + template void RelaxNode(const GraphT &graph, const partition::CellStorage &cells, const std::vector &allowed_nodes, @@ -134,6 +129,7 @@ class CellCustomizer EdgeWeight weight, EdgeDuration duration) const { + auto first_level = level == 1; BOOST_ASSERT(heap.WasInserted(node)); if (!first_level)