Follow-up Comment #7, patch #3829 (project freeciv):
Ah, good point. Perhaps rather than adding roads to the integrators list at
parse time, it ought just set the bitvector (redundantly setting it causes no
issue, and checking that it is set likely usually wastes cycles). Once the
iterates bitvector is set, a list can be constructed from it, sorted by cost
(lowest to highest), and stored as integrators.
Having a separate chunk of code specifically setting integrators should also
make the entirety more readable, so that this confusion doesn't arise again
(as both of us read it as wrong last week, the current code is clearly
I don't think it is safe to terminate the tile_move_cost_ptrs() loop once a
road is found, because we can't know that it hasn't hit the RMM_RELAXED
condition, but the cost of iterating through the remainder should be low,
because we check (cost > iroad->move_cost) early enough that the remainder of
the iteration should go quickly.
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list