Re: Coding guidelines for braces + spaces - link 404's

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Coding guidelines for braces + spaces - link 404's
Дата
Msg-id 23af1b9f-37cf-261a-9667-5edfcfc38f6c@enterprisedb.com
обсуждение исходный текст
Ответ на Coding guidelines for braces + spaces - link 404's  (Kevin Burke <kevin@burke.dev>)
Список 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 по дате отправления:

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: mark the timestamptz variant of date_bin() as stable
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Logical replication timeout problem