Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] Re: (PR#13340) Owner change and happyborders
Home

[Freeciv-Dev] Re: (PR#13340) Owner change and happyborders

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mstefek@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#13340) Owner change and happyborders
From: "Benoit Hudson" <bh@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 27 Jun 2005 08:09:10 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13340 >

On Mon, Jun 27, 2005 at 05:32:47AM -0700, Mateusz Stefek wrote:
> +         hash_insert(cities_to_refresh, &(homecity->id), NULL);

Why not put in homecity?

> +    for (i = 0; i < entries; i++) {
> +      int id = *(int*)hash_key_by_number(cities_to_refresh, i);

This is O(n^2): look at the implementation of hash_key_by_number.

Probably Per is right: a list or vector would do perfectly well despite
their quadratic time, since we will only be having a small number of
cities.

        -- Benoît





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