[haiku-commits] Re: r37305 - haiku/trunk/src/preferences/screensaver

  • From: Michael Pfeiffer <michael.w.pfeiffer@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 30 Jun 2010 16:09:40 +0200

Am 30.06.2010 um 15:50 schrieb Axel Dörfler:

>> +                    BEntry entry(path.Path());
>> +                    entry_ref ref;
>> +                    if (entry.GetRef(&ref) == B_OK)
>> +                            be_roster->Launch(&ref, &fSettings.Message(),
>> +                                    &fScreenSaverTestTeamId);
> 
> * Multiline statement following if() is not enclosed in {}.

I thought this rule was relaxed some time ago. So you could optionally enclose 
the body in {}.
I would even be in favor of enforcing the "always enclose in {}" rule.
It has the advantage, that when you write the code, you don't have to think in 
advance how may lines of code/statements you're going to write.
And you don't have to care about changes later to add/remove the {} depending 
on the number of lines/statements.

Cheers,
Michael

Other related posts: