(PR#10145) Inefficiency in adjust_building_want_by_effects

"Mateusz Stefek" <mstefek-IjDXvh/[email protected]>
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
<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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.