update: Reorder sector production for speed

The update visits sectors in increasing order of country number.
Within a country, it visits in increasing order of sector number,
which is effectively top to bottom, left to right, starting with
absolute 0,0.

The order doesn't actually matter.  Before Chainsaw's option BUDGET,
the update simply visited the sectors in sector number order.  Go back
to that order, because it's faster.  For the update, it's a few
percent in my testing.  For budget, it's more than a third.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-07-13 22:02:40 +02:00
parent c5df505c98
commit 5a548c9901
12 changed files with 132 additions and 127 deletions

View file

@ -169,8 +169,7 @@ calc_all(void)
prod_land(etu, bp, 0);
/* Produce */
for (i = 0; i < MAXNOC; i++)
produce_sect(getnatp(i), etu, bp);
produce_sect(etu, bp);
/* Build ships, planes and land units */
prod_ship(etu, bp, 1);