[freeciv-ai] (PR#9802) generic_city_refresh speedup via caching
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[freeciv-ai] (PR#9802) generic_city_refresh speedup via caching |
From: |
"Benoit Hudson" <bh@xxxxxxxxxxxxxxxxxxx> |
Date: |
Sat, 28 Aug 2004 15:28:14 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9802 >
> [per - Wed Aug 25 19:39:05 2004]:
> On Wed, 25 Aug 2004, Jason Short wrote:
> > > [bhudson - Wed Aug 25 01:26:21 2004]:
> > Assuming the effects patch gets committed soon, I'd rather wait until
> > that's done (your patch touches some building effects code). But if
> > nothing happens on it soon (~1 week) we should go forward with this.
> > This code is a bit complicated so if there's a way to split it up that
> > would be helpful.
What would be a good way to split it up? I can see three things going on:
(1) new struct and field; move the three ints that were cacheing things into
the new struct.
(2) new functions for the CM to call.
(3) more fields in the new struct.
If you think that's a good breakup, I can produce patches.
> Please wait. This work is very important (thank you, Benoit), but also
> important to get right. I have been looking at this area of code (city.c)
> a lot lately, and want to have a closer look at this patch when I get the
> time.
I agree this is a somewhat dangerous patch. The one bug I saw I'd created (and
fixed before
mailing in) was to accidentally make recycling plants *increase* pollution.
I'd be slightly
surprised if I made no other typos. One thing I did which I probably should
not have was to
multiply by a percentage rather than divide by an int; probably the next set of
patches would
include the original arithmetic.
|
|