pgsql: Refactor Copy{From|To}GetRoutine() to use pass-by-reference argu

Started by Masahiko Sawadaover 1 year ago1 messagescommitters
Jump to latest
#1Masahiko Sawada
msawada@postgresql.org

Refactor Copy{From|To}GetRoutine() to use pass-by-reference argument.

The change improves efficiency by eliminating unnecessary copying of
CopyFormatOptions.

The coverity also complained about inefficiencies caused by
pass-by-value.

Oversight in 7717f6300 and 2e4127b6d.

Reported-by: Junwang Zhao <zhjwpku@gmail.com>
Reported-by: Tom Lane <tgl@sss.pgh.pa.us> (per reports from coverity)
Author: Sutou Kouhei <kou@clear-code.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: /messages/by-id/CAEG8a3L6YCpPksTQMzjD_CvwDEhW3D_t=5md9BvvdOs5k+TA=Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bacbc4863b3bfb79b9577f11f2c77e4df9f66d66

Modified Files
--------------
src/backend/commands/copyfrom.c | 8 ++++----
src/backend/commands/copyto.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)