Re: [PATCH] binary heap implementation

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] binary heap implementation
Date: 2012-11-21 20:09:12
Message-ID: CA+TgmoaS2LkoMs8buhhcQ+OfDuw0yhZYjMrNNKLPNMp6iVSOBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 21, 2012 at 1:30 PM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> The following comments still talk about "key and value", thus need
> an update:

Oops.

> This comment needs updated (s/comparator/compare/, and also add
> has_heap_property and arg):

Fixed.

> I would suggest to add prefixes to struct members, so bh_size, bh_space
> and so on. This makes it easier to grep for stuff later.

OK.

> Do we really need the struct definition be public? Couldn't it just
> live in binaryheap.c?

Well, that would preclude defining any macros, like
binaryheap_empty(). Since efficiency is among the reasons for
inventing this in the first place, that doesn't seem prudent to me.

Another new version attached.

P.S. to Abhijit: Please, please tell me the secret to getting five
people to review your patches. I'm lucky when I can get one!

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
binaryheap-rmh3.patch application/octet-stream 16.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-11-21 20:12:26 Re: Doc patch: Document names of automatically created constraints and indexes
Previous Message Jeff Janes 2012-11-21 19:46:37 Re: add -Wlogical-op to standard compiler options?