]> git.tdb.fi Git - r2c2.git/commitdiff
Eliminate an unnecessary variable
authorMikko Rasa <tdb@tdb.fi>
Wed, 11 Feb 2015 12:54:42 +0000 (14:54 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 11 Feb 2015 12:54:42 +0000 (14:54 +0200)
source/libr2c2/trainrouteplanner.cpp

index 08d787805140610a41af21100c4894ea0870c615..653cfda6d9f01fc1288722d8f1c6ca33e47634c6 100644 (file)
@@ -488,10 +488,9 @@ void TrainRoutePlanner::RoutingStep::create_successors(list<RoutingStep> &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<RoutingStep> &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<RoutingStep> &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);