Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9755) provide distribute() in the utility code
Home

[Freeciv-Dev] Re: (PR#9755) provide distribute() in the utility code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9755) provide distribute() in the utility code
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 21 Aug 2004 02:43:52 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9755 >

On Fri, 20 Aug 2004, Jason Short wrote:
> This patch provides a function distribute() in the utility code:
>
>  void distribute(int number, int groups, int *ratios, int *result);
>
> This will distribute "number" elements into "groups" groups with ratios
> given by the elements in "ratios".The resulting division is put into
> the "result" array.
>
> The only user (so far) is the trade disribution code.

Check speed. This code is run very often. Consider doing away with your
asserts and possibly making it inline.

  - Per




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