Re: Coding guidelines for braces + spaces - link 404's - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Coding guidelines for braces + spaces - link 404's
Date
Msg-id 23af1b9f-37cf-261a-9667-5edfcfc38f6c@enterprisedb.com
Whole thread Raw
In response to Coding guidelines for braces + spaces - link 404's  (Kevin Burke <kevin@burke.dev>)
List pgsql-hackers
On 20.09.21 05:37, Kevin Burke wrote:
> I have been working on a patch for Postgres. I'm curious about the 
> suggested style for braces around if statements - some places don't 
> include braces around an if statement body, if the if statement body is 
> a single line.

Generally, the braces should be omitted if the body is only a single 
line.  An exception is sometimes made for symmetry if another branch 
uses more than one line.  So

     if (foo)
         bar();

but

     if (foo)
     {
         bar();
     }
     else
     {
         baz();
         qux();
     }



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: mark the timestamptz variant of date_bin() as stable
Next
From: Amit Kapila
Date:
Subject: Re: Logical replication timeout problem