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: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
From: Justin Moore <justin@xxxxxxxxxxx>
Date: Tue, 21 Aug 2001 12:43:29 -0400 (EDT)

> > 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.

-jdm

Department of Computer Science, Duke University, Durham, NC 27708-0129
Email:  justin@xxxxxxxxxxx

Attachment: sortlist.h
Description: Text document

Attachment: sortlist.c
Description: Text document


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