summaryrefslogtreecommitdiff
path: root/src/backend/tcop
diff options
context:
space:
mode:
authorPeter Eisentraut2017-09-07 16:06:23 +0000
committerPeter Eisentraut2017-09-07 17:56:09 +0000
commit1356f78ea93395c107cbc75dc923e29a0efccd8a (patch)
treea06cc9e40efdf8382692fb79b5b22c3920f93b5f /src/backend/tcop
parent9d71323daca412e6e175595e1e42809fb5e1172d (diff)
Reduce excessive dereferencing of function pointers
It is equivalent in ANSI C to write (*funcptr) () and funcptr(). These two styles have been applied inconsistently. After discussion, we'll use the more verbose style for plain function pointer variables, to make it clear that it's a variable, and the shorter style when the function pointer is in a struct (s.func() or s->func()), because then it's clear that it's not a plain function name, and otherwise the excessive punctuation makes some of those invocations hard to read. Discussion: https://www.postgresql.org/message-id/f52c16db-14ed-757d-4b48-7ef360b1631d@2ndquadrant.com
Diffstat (limited to 'src/backend/tcop')
-rw-r--r--src/backend/tcop/postgres.c4
-rw-r--r--src/backend/tcop/pquery.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index c10d891260c..4eb85720a74 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -1114,7 +1114,7 @@ exec_simple_query(const char *query_string)
receiver,
completionTag);
- (*receiver->rDestroy) (receiver);
+ receiver->rDestroy(receiver);
PortalDrop(portal, false);
@@ -2002,7 +2002,7 @@ exec_execute_message(const char *portal_name, long max_rows)
receiver,
completionTag);
- (*receiver->rDestroy) (receiver);
+ receiver->rDestroy(receiver);
if (completed)
{
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index 7e820d05dd9..cc462efc370 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -1049,7 +1049,7 @@ FillPortalStore(Portal portal, bool isTopLevel)
if (completionTag[0] != '\0')
portal->commandTag = pstrdup(completionTag);
- (*treceiver->rDestroy) (treceiver);
+ treceiver->rDestroy(treceiver);
}
/*
@@ -1073,7 +1073,7 @@ RunFromStore(Portal portal, ScanDirection direction, uint64 count,
slot = MakeSingleTupleTableSlot(portal->tupDesc);
- (*dest->rStartup) (dest, CMD_SELECT, portal->tupDesc);
+ dest->rStartup(dest, CMD_SELECT, portal->tupDesc);
if (ScanDirectionIsNoMovement(direction))
{
@@ -1103,7 +1103,7 @@ RunFromStore(Portal portal, ScanDirection direction, uint64 count,
* has closed and no more tuples can be sent. If that's the case,
* end the loop.
*/
- if (!((*dest->receiveSlot) (slot, dest)))
+ if (!dest->receiveSlot(slot, dest))
break;
ExecClearTuple(slot);
@@ -1119,7 +1119,7 @@ RunFromStore(Portal portal, ScanDirection direction, uint64 count,
}
}
- (*dest->rShutdown) (dest);
+ dest->rShutdown(dest);
ExecDropSingleTupleTableSlot(slot);