Refactoring: join MakeSingleTupleTableSlot() and MakeTupleTableSlot() - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Refactoring: join MakeSingleTupleTableSlot() and MakeTupleTableSlot()
Date
Msg-id CAJ7c6TOg==suNRgtPFKPxp-Uau5R3OW0QCXS_XCxjVkrrBuz2g@mail.gmail.com
Whole thread Raw
Responses Re: Refactoring: join MakeSingleTupleTableSlot() and MakeTupleTableSlot()  (Michael Paquier <michael@paquier.xyz>)
Re: Refactoring: join MakeSingleTupleTableSlot() and MakeTupleTableSlot()  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Hi hackers,

During the discussion [1] it was discovered that we have two
procedures in execTuples.c that do the same thing:

* MakeSingleTupleTableSlot()
* MakeTupleTableSlot()

In fact, MakeSingleTupleTableSlot() is simply a wrapper for
MakeTupleTableSlot().

I propose keeping only one of these procedures to simplify navigating
through the code and debugging, and maybe saving a CPU cycle or two. A
search for MakeTupleTableSlot produced 8 matches across 2 files, while
MakeSingleTupleTableSlot is used 41 times across 26 files. Thus the
proposed patch removes MakeTupleTableSlot and keeps
MakeSingleTupleTableSlot to keep the patch less invasive and simplify
backporting of the other patches. Hopefully, this will not complicate
the life of the extension developers too much.

The patch was tested on MacOS against `master` branch b1ce6c28.

[1]: https://www.postgresql.org/message-id/flat/CAJ7c6TP0AowkUgNL6zcAK-s5HYsVHVBRWfu69FRubPpfwZGM9A%40mail.gmail.com

-- 
Best regards,
Aleksander Alekseev

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Fix memory corruption in pg_shdepend.c
Next
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] Fix memory corruption in pg_shdepend.c