Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#7280) Tile pointer in unit struct
Home

[Freeciv-Dev] (PR#7280) Tile pointer in unit struct

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: a-l@xxxxxxx
Subject: [Freeciv-Dev] (PR#7280) Tile pointer in unit struct
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Jan 2004 23:12:29 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [i-freeciv-lists@xxxxxxxxxxxxx - Wed Jan 21 08:08:24 2004]:

> The last point could be solved by having functions/macros like:
> 
>   unit_tile(punit)
>   unit_tile_city(punit)
> 
> which than use or don't use a cached tile pointer. So what about a
> single new function/macro unit_tile(punit) and than writing
> unit_tile(punit)->city?

But since this whole argument is about speed, the implementation does
matter.  If unit_tile is implemented via map_get_tile then you want to
cache it locally.  If it's just a pointer lookup you needn't bother.

jason



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