Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
Home

[Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Justin Moore <justin@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Aug 2001 19:17:13 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Aug 21, 2001 at 12:43:29PM -0400, Justin Moore wrote:
> 
> > > Why not just:?
> > >
> > > > struct sortlist {
> > > >   int capacity;
> > > >   int num_links;
> > > >   void *data;
> > > > };
> 
>    Here are the changes.  The actual array ended up being a void** so it
> would be an array of generic pointers.  Also I've replaced the for() loops
> which moved the data with memmoves to scoot everything up or back on
> insertions and deletions.  As always, feel free to double-check my math on
> the moves and insertion and such.

I'm still not convinced that an always sorted list is necessary. The
removal of this would simplify the code. The only place which uses
sorting is in server/savegame.c.

> struct sortlist {
>   int capacity;
>   int num_links;
>   void **data;
> };

Could you move this into the c file?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Sit, disk, sit. Good boy. Now spin up. Very good. Here's a netscape
  cookie for you. Fetch me some data. Come on, you can do it. No, not that
  data. Bad disk. Bad." 
    -- Calle Dybedahl, alt.sysadmin.recovery


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