Skip to content

Commit

Permalink
lookup: simplify check for infeasibility
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Oct 31, 2024
1 parent d7aacbe commit 6c7f593
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions include/osr/lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,13 @@ struct lookup {
bitvec<node_idx_t> 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<distance_t>(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_,
Expand Down

0 comments on commit 6c7f593

Please sign in to comment.