From 6a351de12a65e5a005e73bca7e1bba26dbe4288f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 11 Feb 2015 14:54:42 +0200 Subject: [PATCH] Eliminate an unnecessary variable --- source/libr2c2/trainrouteplanner.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/libr2c2/trainrouteplanner.cpp b/source/libr2c2/trainrouteplanner.cpp index 08d7878..653cfda 100644 --- a/source/libr2c2/trainrouteplanner.cpp +++ b/source/libr2c2/trainrouteplanner.cpp @@ -488,10 +488,9 @@ void TrainRoutePlanner::RoutingStep::create_successors(list &new_st return; } - TrackIter next_track = train.track.next(train.path); train.advance_track(0); - const TrackType::Endpoint &next_entry_ep = next_track.endpoint(); + const TrackType::Endpoint &entry_ep = train.track.endpoint(); if(train.critical) { train.path = train.track->get_type().coerce_path(train.track.entry(), train.track->get_active_path()); @@ -502,8 +501,8 @@ void TrainRoutePlanner::RoutingStep::create_successors(list &new_st } else { - for(unsigned i=0; next_entry_ep.paths>>i; ++i) - if(next_entry_ep.has_path(i)) + for(unsigned i=0; entry_ep.paths>>i; ++i) + if(entry_ep.has_path(i)) { train.path = i; train.update_estimate(); @@ -520,7 +519,7 @@ void TrainRoutePlanner::RoutingStep::create_successors(list &new_st i->update_estimate(); } - if(next_entry_ep.paths!=next_track->get_type().get_paths() && !train.critical) + if(entry_ep.paths!=train.track->get_type().get_paths() && !train.critical) { RoutingStep wait(this); wait.advance(dt); -- 2.45.2