Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#4075) rewrite base_map_to_city_map
Home

[Freeciv-Dev] Re: (PR#4075) rewrite base_map_to_city_map

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#4075) rewrite base_map_to_city_map
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Apr 2003 16:15:26 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Jason Short wrote:
> I was looking at city.c today and notice that base_city_map_to_map is 
> encoded using a brute-force approach.  I instead rewrote it using 
> map_distance_vector (this function was probably not available with the 
> current version was written).  This makes the function algorithmically 
> faster - O(1) versus O(n) - although constant factors are likely to have 
> an even larger effect.  And of course it's more elegant.

I should also mention that savefiles generated by autogames are 
unaffected by this change.

jason




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