1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Fixup some appendStringInfo and appendPQExpBuffer calls

A number of places were using appendStringInfo() when they could have been
using appendStringInfoString() instead.  While there's no functionality
change there, it's just more efficient to use appendStringInfoString()
when no formatting is required.  Likewise for some
appendStringInfoString() calls which were just appending a single char.
We can just use appendStringInfoChar() for that.

Additionally, many places were using appendPQExpBuffer() when they could
have used appendPQExpBufferStr(). Change those too.

Patch by Zhijie Hou, but further searching by me found significantly more
places that deserved the same treatment.

Author: Zhijie Hou, David Rowley
Discussion: https://postgr.es/m/cb172cf4361e4c7ba7167429070979d4@G08CNEXMBPEKD05.g08.fujitsu.local
This commit is contained in:
David Rowley
2020-10-15 20:35:17 +13:00
parent 73c381cee7
commit 110d81728a
15 changed files with 210 additions and 216 deletions

View File

@ -2591,8 +2591,8 @@ postgresExplainForeignScan(ForeignScanState *node, ExplainState *es)
quote_identifier(relname));
}
else
appendStringInfo(relations, "%s",
quote_identifier(relname));
appendStringInfoString(relations,
quote_identifier(relname));
refname = (char *) list_nth(es->rtable_names, rti - 1);
if (refname == NULL)
refname = rte->eref->aliasname;