From 6c7f593aa694700a39084cfda8552422aa2c05d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Thu, 31 Oct 2024 22:57:48 +0100 Subject: [PATCH] lookup: simplify check for infeasibility --- include/osr/lookup.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/osr/lookup.h b/include/osr/lookup.h index 51b89ee..7244c0b 100644 --- a/include/osr/lookup.h +++ b/include/osr/lookup.h @@ -154,15 +154,13 @@ struct lookup { bitvec const* blocked) const { auto const way_prop = ways_.r_->way_properties_[wc.way_]; auto const edge_dir = reverse ? opposite(dir) : dir; - auto const way_cost = - Profile::way_cost(way_prop, flip(search_dir, edge_dir), 0U); - if (way_cost == kInfeasible) { - return node_candidate{}; - } - auto const offroad_cost = Profile::way_cost(way_prop, flip(search_dir, edge_dir), static_cast(wc.dist_to_way_)); + if (offroad_cost == kInfeasible) { + return node_candidate{}; + } + auto c = node_candidate{.lvl_ = lvl, .way_dir_ = dir, .dist_to_node_ = wc.dist_to_way_,