Re: Passing CopyMultiInsertInfo structure toCopyMultiInsertInfoNextFreeSlot() - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Passing CopyMultiInsertInfo structure toCopyMultiInsertInfoNextFreeSlot()
Date
Msg-id 20190516214019.GA18271@alvherre.pgsql
Whole thread Raw
In response to Re: Passing CopyMultiInsertInfo structure toCopyMultiInsertInfoNextFreeSlot()  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Passing CopyMultiInsertInfo structure to CopyMultiInsertInfoNextFreeSlot()
List pgsql-hackers
On 2019-May-14, Michael Paquier wrote:

> On Tue, May 14, 2019 at 01:19:30PM +1200, David Rowley wrote:
> > When I wrote the code I admit that I was probably wearing my
> > object-orientated programming hat. I had in mind that the whole
> > function series would have made a good class.  Passing the
> > CopyMultiInsertInfo was sort of the non-OOP equivalent to having
> > this/Me/self available, as it would be for any instance method of a
> > class.  Back to reality, this isn't OOP, so I was wearing the wrong
> > hat.  I think the unused parameter should likely be removed.  It's
> > probably not doing a great deal of harm since the function is static
> > inline and the compiler should be producing any code for the unused
> > param, but for the sake of preventing confusion, it should be removed.
> > Ashutosh had to ask about it, so it wasn't immediately clear what the
> > purpose of it was. Since there's none, be gone with it, I say.
> 
> Sounds fair to me.  This has been introduced by 86b8504, so let's see
> what's Andres take.

If this were up to me, I'd leave the function signature alone, and just add
    (void) miinfo;        /* unused parameter */
to the function code.  It seems perfectly reasonable to have that
function argument, and a little weird not to have it.

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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Adding a test for speculative insert abort case
Next
From: Thomas Munro
Date:
Subject: Re: PSA: New intel MDS vulnerability mitigations cause measurable slowdown