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();
    }


Reply via email to