From 2075ba9dc9af8833b1147996c15246e44a1e4fab Mon Sep 17 00:00:00 2001 From: David Rowley Date: Tue, 3 Oct 2023 17:09:52 +1300 Subject: Tidy-up some appendStringInfo*() usages Make a few newish calls to appendStringInfo() which have no special formatting use appendStringInfoString() instead. Also, adjust usages of appendStringInfoString() which only append a string containing a single character to make use of appendStringInfoChar() instead. This makes the code marginally faster, but primarily this change is so we use the StringInfo type as it was intended to be used. Discussion: https://postgr.es/m/CAApHDvpXKQmL+r=VDNS98upqhr9yGBhv2Jw3GBFFk_wKHcB39A@mail.gmail.com --- src/backend/utils/adt/ruleutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/ruleutils.c') diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 8d5eac47916..442205382e3 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -10395,7 +10395,7 @@ get_func_sql_syntax(FuncExpr *expr, deparse_context *context) case F_IS_NORMALIZED: /* IS xxx NORMALIZED */ - appendStringInfoString(buf, "("); + appendStringInfoChar(buf, '('); get_rule_expr_paren((Node *) linitial(expr->args), context, false, (Node *) expr); appendStringInfoString(buf, " IS"); @@ -10884,7 +10884,7 @@ get_json_constructor(JsonConstructorExpr *ctor, deparse_context *context, } get_json_constructor_options(ctor, buf); - appendStringInfo(buf, ")"); + appendStringInfoChar(buf, ')'); } /* -- cgit v1.2.3