Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: [patch] clause_list speclist
Home

[Freeciv-Dev] Re: [patch] clause_list speclist

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Justin Moore <justin@xxxxxxxxxxx>
Cc: Freeciv Developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [patch] clause_list speclist
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 Sep 2001 09:44:46 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Sep 18, 2001 at 06:08:05PM -0400, Justin Moore wrote:
> 
>    Going through the common and server code, I noticed some places in the
> diplomacy code where for() loops were used instead of speclist stuff.
> Noticed speclist stuff didn't exist for treaty clauses.  Created speclist
> types for treaty clauses.  Treaty clauses now seem more content with their
> place in life. :) Not that this is a huge performance gain; more for
> consistancy among the iterators.

I love such patches.

> +  struct city *pcity;

> -    for (;ITERATOR_PTR(myiter); ITERATOR_NEXT(myiter)) {
> -      struct Clause *pclause = (struct Clause *)ITERATOR_PTR(myiter);
> -      struct city *pcity;
> -
> +    clause_list_iterate(ptreaty->clauses, pclause) {

IMHO variables should be declared in the most inner scope to prevent a
pollution of the namespace.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  The trick is to keep breathing.


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