Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: PATCH: map iteration (PR#1018)
Home

[Freeciv-Dev] Re: PATCH: map iteration (PR#1018)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: PATCH: map iteration (PR#1018)
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: Sun, 04 Nov 2001 03:21:24 +0000

On Tue, 30 Oct 2001, rwetmore@xxxxxxxxxxxx wrote:

> At 05:17 AM 01/10/30 -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
>>4.  Is regular_map_pos_is_normal good, or should we stick to
>>is_normal_map_pos?  Again, regular_map_pos_is_normal provides
>>identical functionality but assumes the map position it is given is
>>"regular", i.e. within (0..map.xsize-1,0..map.ysize-1).  This makes
>>it much faster.
> 
> I'm not much of a fan of regular. You need to demonstrate it a bit
> more to show any real value. If it never does anything, then dubious
> dregs like this are just noise.

I agree with Ross.

Until and unless someone exhibits a shape which requires such a
concept, guaranteeing that each tile occurs precisely once in

  [0, map.xsize) x [0, map.ysize)

and using a two nested for loops with is_real_tile() inside offers a
good tradeoff between readability, predictability, efficiency and
generality.  There is not reason to create problems for ourselves
before we have to.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
FUN is never having to say you're SUSHI!!


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