]> git.tdb.fi Git - r2c2.git/commitdiff
Don't bother with creating intermediate steps for state updates
authorMikko Rasa <tdb@tdb.fi>
Fri, 20 Feb 2015 22:42:40 +0000 (00:42 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 20 Feb 2015 22:42:40 +0000 (00:42 +0200)
They were needed back when the wait system was different, but no longer
have any use.

source/libr2c2/trainrouteplanner.cpp

index 0140f439a7a61ba8ec80570f4c42430ae8c64afe..4186f471c43afcc7322071d53402aa690b7350c7 100644 (file)
@@ -490,14 +490,8 @@ TrainRoutePlanner::RoutingStep::RoutingStep(const RoutingStep *p):
 void TrainRoutePlanner::RoutingStep::create_successors(list<RoutingStep> &new_steps) const
 {
        RoutingStep next(this);
-       if(next.update_states())
-       {
-               if(next.check_deadlocks())
-                       return;
-
-               new_steps.push_back(next);
+       if(next.update_states() && next.check_deadlocks())
                return;
-       }
 
        int train_index = find_next_train();
        if(train_index<0)