Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] (PR#7345) auto_arrange_workers callers need to be redesign
Home

[Freeciv-Dev] (PR#7345) auto_arrange_workers callers need to be redesign

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#7345) auto_arrange_workers callers need to be redesigned
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Mon, 2 Feb 2004 00:54:36 -0800
Reply-to: rt@xxxxxxxxxxx

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

I removed the call to auto_arrange_workers() (along with the calls to
city_refresh() and send_city_info() ) from update_city_tile_status(),
and created wrapper functions called
update_city_tile_status_arrange_workers() and
update_city_tile_status_map_arrange_workers() which implement the old
functionality.  I also added two more functions,
update_all_city_tile_status() and
update_all_city_tile_status_arrange_workers(), which update all of the
tiles in a city, the second function deferring auto_arrange_workers()
until all of the tiles had been updated.

I'm not sure if I put city_refresh() and send_city_info() calls in all
the necessary places, but I ran a quick autogame and found that the
savegames matched.

Another problem is the performance difference was negligible, small
enough to be considered experimental error :)

CVS:
real    4m44.419s
user    0m0.090s
sys     0m0.230s

patched:
real    4m43.768s
user    0m0.070s
sys     0m0.250s

So it's probably not worth it.  Patch is attached anyway.  :)

-James Canete

Attachment: autoarrangeworkers_update.diff
Description: Binary data


[Prev in Thread] Current Thread [Next in Thread]