diff options
| author | Peter Eisentraut | 2017-09-07 16:06:23 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2017-09-07 17:56:09 +0000 |
| commit | 1356f78ea93395c107cbc75dc923e29a0efccd8a (patch) | |
| tree | a06cc9e40efdf8382692fb79b5b22c3920f93b5f /src/backend/commands | |
| parent | 9d71323daca412e6e175595e1e42809fb5e1172d (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/[email protected]
Diffstat (limited to 'src/backend/commands')
| -rw-r--r-- | src/backend/commands/analyze.c | 4 | ||||
| -rw-r--r-- | src/backend/commands/portalcmds.c | 2 | ||||
| -rw-r--r-- | src/backend/commands/seclabel.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index fbad13ea94f..08fc18e96b4 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -526,7 +526,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params, stats->rows = rows; stats->tupDesc = onerel->rd_att; - (*stats->compute_stats) (stats, + stats->compute_stats(stats, std_fetch_func, numrows, totalrows); @@ -830,7 +830,7 @@ compute_index_stats(Relation onerel, double totalrows, stats->exprvals = exprvals + i; stats->exprnulls = exprnulls + i; stats->rowstride = attr_cnt; - (*stats->compute_stats) (stats, + stats->compute_stats(stats, ind_fetch_func, numindexrows, totalindexrows); diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c index 46369cf3dbe..b36473fba44 100644 --- a/src/backend/commands/portalcmds.c +++ b/src/backend/commands/portalcmds.c @@ -397,7 +397,7 @@ PersistHoldablePortal(Portal portal) /* Fetch the result set into the tuplestore */ ExecutorRun(queryDesc, ForwardScanDirection, 0L, false); - (*queryDesc->dest->rDestroy) (queryDesc->dest); + queryDesc->dest->rDestroy(queryDesc->dest); queryDesc->dest = NULL; /* diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c index 5f16d6cf1c1..b0b06fc91fa 100644 --- a/src/backend/commands/seclabel.c +++ b/src/backend/commands/seclabel.c @@ -122,7 +122,7 @@ ExecSecLabelStmt(SecLabelStmt *stmt) } /* Provider gets control here, may throw ERROR to veto new label. */ - (*provider->hook) (&address, stmt->label); + provider->hook(&address, stmt->label); /* Apply new label. */ SetSecurityLabel(&address, provider->provider_name, stmt->label); |
