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

From Andrew Dunstan
Subject Re: [PATCH] binary heap implementation
Date
Msg-id 50A51369.1060004@dunslane.net
Whole thread Raw
In response to Re: [PATCH] binary heap implementation  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PATCH] binary heap implementation  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
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. Personally I think it's a bad rule, at least as stated, in the 
case where there's an else clause with a compound statement. I'd prefer 
to see a rule that says that either both branches of an if/else should 
be compound statements or neither should be. I think the cases where 
only one branch is a compound statement are rather ugly.

cheers

andrew




pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: WIP patch for hint bit i/o mitigation
Next
From: Robert Haas
Date:
Subject: Re: tuplesort memory usage: grow_memtuples