pgsql: Use appendBinaryStringInfo in more places where the length is kn

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use appendBinaryStringInfo in more places where the length is kn
Date: 2019-07-22 12:14:36
Message-ID: E1hpXDA-0004Be-Vl@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use appendBinaryStringInfo in more places where the length is known

When we already know the length that we're going to append, then it
makes sense to use appendBinaryStringInfo instead of
appendStringInfoString so that the append can be performed with a simple
memcpy() using a known length rather than having to first perform a
strlen() call to obtain the length.

Discussion: https://postgr.es/m/CAKJS1f8+FRAM1s5+mAa3isajeEoAaicJ=4e0WzrH3tAusbbiMQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1e6a759838f7c104f3cd1fe6981a98780da4131b

Modified Files
--------------
contrib/postgres_fdw/deparse.c | 4 ++--
src/backend/executor/execMain.c | 4 ++--
src/backend/executor/execPartition.c | 2 +-
src/backend/storage/lmgr/deadlock.c | 2 +-
src/backend/utils/adt/ri_triggers.c | 4 ++--
src/backend/utils/adt/ruleutils.c | 10 +++++-----
src/backend/utils/adt/xml.c | 12 +++++++-----
7 files changed, 20 insertions(+), 18 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2019-07-22 13:20:27 pgsql: initdb: Change authentication defaults
Previous Message Peter Eisentraut 2019-07-22 10:16:23 pgsql: Make identity sequence management more robust