1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Use appendStringInfoString instead of appendStringInfo where possible.

This shaves a few cycles, and generally seems like good programming
practice.

David Rowley
This commit is contained in:
Robert Haas
2013-10-31 10:55:59 -04:00
parent 343bb134ea
commit cacbdd7810
33 changed files with 399 additions and 404 deletions

View File

@ -841,7 +841,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root,
if (targetAttrs)
{
appendStringInfoString(buf, "(");
appendStringInfoChar(buf, '(');
first = true;
foreach(lc, targetAttrs)
@ -869,7 +869,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root,
pindex++;
}
appendStringInfoString(buf, ")");
appendStringInfoChar(buf, ')');
}
else
appendStringInfoString(buf, " DEFAULT VALUES");
@ -989,7 +989,7 @@ deparseAnalyzeSizeSql(StringInfo buf, Relation rel)
initStringInfo(&relname);
deparseRelation(&relname, rel);
appendStringInfo(buf, "SELECT pg_catalog.pg_relation_size(");
appendStringInfoString(buf, "SELECT pg_catalog.pg_relation_size(");
deparseStringLiteral(buf, relname.data);
appendStringInfo(buf, "::pg_catalog.regclass) / %d", BLCKSZ);
}
@ -1302,7 +1302,7 @@ deparseConst(Const *node, deparse_expr_cxt *context)
if (node->constisnull)
{
appendStringInfo(buf, "NULL");
appendStringInfoString(buf, "NULL");
appendStringInfo(buf, "::%s",
format_type_with_typemod(node->consttype,
node->consttypmod));
@ -1650,7 +1650,7 @@ deparseOperatorName(StringInfo buf, Form_pg_operator opform)
else
{
/* Just print operator name. */
appendStringInfo(buf, "%s", opname);
appendStringInfoString(buf, opname);
}
}

View File

@ -787,7 +787,7 @@ postgresGetForeignPlan(PlannerInfo *root,
root->parse->commandType == CMD_DELETE))
{
/* Relation is UPDATE/DELETE target, so use FOR UPDATE */
appendStringInfo(&sql, " FOR UPDATE");
appendStringInfoString(&sql, " FOR UPDATE");
}
else
{
@ -808,11 +808,11 @@ postgresGetForeignPlan(PlannerInfo *root,
{
case LCS_FORKEYSHARE:
case LCS_FORSHARE:
appendStringInfo(&sql, " FOR SHARE");
appendStringInfoString(&sql, " FOR SHARE");
break;
case LCS_FORNOKEYUPDATE:
case LCS_FORUPDATE:
appendStringInfo(&sql, " FOR UPDATE");
appendStringInfoString(&sql, " FOR UPDATE");
break;
}
}