Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2004:
[freeciv-ai] (PR#10145) Inefficiency in adjust_building_want_by_effects
Home

[freeciv-ai] (PR#10145) Inefficiency in adjust_building_want_by_effects

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#10145) Inefficiency in adjust_building_want_by_effects
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Thu, 16 Sep 2004 02:07:00 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10145 >

  cities[EFR_CONTINENT] = 0;
  city_list_iterate(pplayer->cities, acity) {
    if (map_get_tile(acity->x, acity->y)->continent == ptile->continent)
      cities[EFR_CONTINENT]++;
  } city_list_iterate_end;

We can take the value of cites[EFR_CONTINENT] from AI statistics in O(1)
time.
--
mateusz



[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#10145) Inefficiency in adjust_building_want_by_effects, Mateusz Stefek <=