[Freeciv-Dev] Re: Military amortize (PR#1196)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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/
|
|