[Code v3.5] Suggestion Regarding stadt_t::step_p****agiere()
Hi James,
Regarding the following part of code in stadt_t::step_p****agiere() :
ITERATE(start_halts,i)
{
if(start_halts.get_count() < 1)
{
break;
}
halthandle_t current_halt = start_halts[i];
#ifdef NEW_PATHING
uint16 current_journey_time = current_halt->find_route(pax, best_journey_time);
I see that, for each ware packet, find_route() is called once per start halt. The same ziel halt list for the same ziel pos will get created each time find_route() is invoked, causing redundant efforts. While find_route() is certainly useful in cases where you only need to find the best route from a single start halt, it is not very efficient when you want to check multiple start halts against multiple ziel halts.
IMHO, find_route() can be incorporated into the iteration above, by nesting an iteration of ziel halts within. In this way, you can build the ziel list once, and you can even save the overhead of calling find_route().