Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] is_normal_tile function
Home

[Freeciv-Dev] Re: [PATCH] is_normal_tile function

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: Jason Dorje Short <jshort@xxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] is_normal_tile function
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Aug 2001 22:48:03 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Aug 15, 2001 at 09:41:17PM +0100, Gregory Berkolaiko wrote:
>  --- Jason Dorje Short <jshort@xxxxxxxxxxxxx> wrote: 
> > +***************************************************************/
> > +int is_normal_tile(int x, int y)
> > +{
> > +  return 0 <= y && y < map.ysize && 0 <= x && x < map.xsize;
> > +}
> 
> you might want to use Ross' geeky way of writing such things:
> 
> return ((unsigned) y < (unsigned) map.ysize) && (....)
> 
> or am I as usual missing something?

It is interesting to see that even a simple function can be
obfuscated.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "Heuer's Law: Any feature is a bug unless it can be turned off."


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