Prune the right branch on red signal end-of-line
commit2699f279fa7d75bbb09f1ddd07616f4743a6acef
authorcirdan <cirdansw@gmail.com>
Fri, 28 Mar 2014 20:21:43 +0000 (28 21:21 +0100)
committercirdan <cirdansw@gmail.com>
Fri, 28 Mar 2014 20:21:43 +0000 (28 21:21 +0100)
tree766a111dabde852580a55186e886e621bb20f0a2
parent3be63114bec53af303034163304ef7184a97beee
Prune the right branch on red signal end-of-line

With yapf.rail_firstred_twoway_eol set to true, when the first
signal found is a red two-way signal, the path leading to it
must be pruned in case the best intermediate node is an earlier
node in the branch but without an intervening junction, because
otherwise heading for that intermediate node would eventually
lead to the red two-way signal anyway. However, the code in
PruneIntermediateNodeBranch was pruning the branch containing
the best intermediate node irrespectively of whether it was an
ancestor of the segment with the red two-way signal or there was
a junction in-between. Fix this by pruning the branch only when
appropriate, and inline PruneIntermediateNodeBranch while at it.
src/pathfinder/yapf/yapf_rail.cpp