Re: [PATCH] binary heap implementation - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [PATCH] binary heap implementation
Date
Msg-id 20121115162702.GI5585@alvh.no-ip.org
Whole thread Raw
In response to Re: [PATCH] binary heap implementation  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan escribió:
>
> On 11/15/2012 10:11 AM, Robert Haas wrote:
>
> >+    {
> >+        sift_down(heap, i);
> >+    }
> >
> >Project style is to omit braces for a single-line body.  This comes up
> >a few other places as well.
>
> I thought we modified that some years ago, although my memory of it
> is a bit hazy.

No, we only modified pg_indent to not take the braces off, because
of PG_TRY blocks.  But we keep using single statements instead of
compound in many places; but there is no hard rule about it.  To me,
using braces were they are not needed is pointless and ugly.  We're very
careful about ensuring that our macro definitions work nicely with
single-statement if/else, for example.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: WIP patch for hint bit i/o mitigation
Next
From: Peter Eisentraut
Date:
Subject: Re: [PATCH 03/14] Add simple xlogdump tool