Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: map_same_continent().
Home

[Freeciv-Dev] Re: map_same_continent().

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gaute B Strokkenes <gs234@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: map_same_continent().
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 Sep 2001 10:03:35 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Sep 19, 2001 at 01:55:44AM +0200, Gaute B Strokkenes wrote:
> 
> The function map_same_continent() is used only 7 places in the code.
> Its sole task is to call map_get_continent() twice and compare the
> results.
> 
> On the other hand, there are lots of places that do exactly the same
> thing manually, either directly or by caching one of the results in a
> variable.
> 
> As such, I do not believe that map_same_continent() serves any
> appreciable purpose other than save a few characters' worth of screen
> real estate in just a couple of functions.  Therefore, I propose to
> remove it entirely, so that future generations of Freeciv source
> readers will have one less function to digest.

Pro (leave it): 
 - it encapsulate things (decrease the entropy)
 - it is possible that there is a faster way to implement it (an item
 "fast continent iteration (or at least an abstraction)" is still on
 my wishlist)

Con (remove):
 - it is unlikly that another implementation is faster that the current
 one
 - if you do it manually you can cache one value

I have no strong opinion.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Only one human captain has ever survived battle with the Minbari
  fleet. He is behind me. You are in front of me. If you value your 
  lives, be somewhere else."
    -- Ambassador Delenn, "Severed Dreams," Babylon 5


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