Avoid pointless calls to FindSafePositionOnPath
commit80088c92f240200da4b29568fa4a6c5d02182b69
authorcirdan <cirdansw@gmail.com>
Sat, 8 Feb 2014 12:18:32 +0000 (8 13:18 +0100)
committercirdan <cirdansw@gmail.com>
Sat, 8 Feb 2014 12:18:32 +0000 (8 13:18 +0100)
tree72d106abed38a0de45ec0259f243744b4b197988
parent29cfb1cf7919beb3cefc1c50afbcc54bd1a976eb
Avoid pointless calls to FindSafePositionOnPath

Calling CYapfReserveTrack::FindSafePositionOnPath only makes sense
if you intend to later call CYapfReserveTrack::TryReservePath to
reserve the path up to the position found; otherwise, it is just
wasting cycles. Even if the path has to be walked back to the
starting point, it is better to do it manually without checking
each intervening node for a safe position. Also add some assertions
for conditions involving FindSafePositionOnPath that should always
hold.
src/pathfinder/yapf/yapf_rail.cpp