diff options
author | David Rowley <drowley@postgresql.org> | 2020-10-15 20:35:17 +1300 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2020-10-15 20:35:17 +1300 |
commit | 110d81728a0a006abcf654543fc15346f8043dc0 (patch) | |
tree | eb0caef08d002a3bc627bcb8de2e5b1d65925abc /src/backend/utils/adt/jsonpath.c | |
parent | 73c381cee71e7dd8a78a394731958b0bbb4d8991 (diff) | |
download | postgresql-110d81728a0a006abcf654543fc15346f8043dc0.tar.gz postgresql-110d81728a0a006abcf654543fc15346f8043dc0.zip |
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
Diffstat (limited to 'src/backend/utils/adt/jsonpath.c')
-rw-r--r-- | src/backend/utils/adt/jsonpath.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/jsonpath.c b/src/backend/utils/adt/jsonpath.c index 3c0dc38a7f8..31d9d92d14e 100644 --- a/src/backend/utils/adt/jsonpath.c +++ b/src/backend/utils/adt/jsonpath.c @@ -660,7 +660,7 @@ printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey, else if (v->content.anybounds.first == v->content.anybounds.last) { if (v->content.anybounds.first == PG_UINT32_MAX) - appendStringInfo(buf, "**{last}"); + appendStringInfoString(buf, "**{last}"); else appendStringInfo(buf, "**{%u}", v->content.anybounds.first); |