Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: Military amortize (PR#1196)
Home

[Freeciv-Dev] Re: Military amortize (PR#1196)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Military amortize (PR#1196)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Sat, 5 Jan 2002 04:21:00 -0800 (PST)

Dear diary, on Sat, Jan 05, 2002 at 01:16:10PM CET, I got a letter,
where Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> told me, that...
> > > I like ternary operators :(
> > > An if will take 5 lines :(
> >          needferry = ((!sanity && !boatid && is_ground_unit(punit)) ? 
> >                       40 : 0);
> > vs
> >          if (!sanity && !boatid && is_ground_unit(punit)
> >            needferry = 40;
> >          else
> >            needferry = 0;
> 
> no, it's
> 
>   if (!sanity && !boatid && is_ground_unit(punit) {
>     needferry = 40;
>   } else {
>     needferry = 0;
>   }
Even better! :) Ternary operator just makes no sense for me here ;-).

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv, (e)links
.
The advantage of GUI is that you can see everything you can change.
The disadvantage of GUI is that you can change only what you can see.
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/



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