Skip to content

Commit d42791a

Browse files
authored
Merge pull request #24 from hove-io/reapply_commits
Reapply commits
2 parents 1be3be6 + b5269b9 commit d42791a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/thor/timedistancebssmatrix.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ bool TimeDistanceBSSMatrix::UpdateDestinations(
463463
// Subtract the partial remaining cost and distance along the edge.
464464
float remainder = dest_edge->second;
465465
Cost newcost = pred.cost() - (pedestrian_costing_->EdgeCost(edge, tile) * remainder);
466-
if (newcost.cost < dest.best_cost.cost) {
466+
if (newcost.cost > 0 && newcost.cost < dest.best_cost.cost) {
467467
dest.best_cost = newcost;
468468
dest.distance = pred.path_distance() - (edge->length() * remainder);
469469
}

src/thor/timedistancematrix.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ bool TimeDistanceMatrix::UpdateDestinations(
518518
float remainder = dest_edge->second;
519519
Cost newcost =
520520
pred.cost() - (costing_->EdgeCost(edge, tile, time_info, flow_sources) * remainder);
521-
if (newcost.cost < dest.best_cost.cost) {
521+
if (newcost.cost > 0 && newcost.cost < dest.best_cost.cost) {
522522
dest.best_cost = newcost;
523523
dest.distance = pred.path_distance() - (edge->length() * remainder);
524524
}

0 commit comments

Comments
 (0)