Re: Avoid unused value (src/fe_utils/print.c)
Ranier Vilela <ranier.vf@gmail.com>
From: Ranier Vilela <ranier.vf@gmail.com>
To: marko@joh.to
Cc: Karina Litskevich <litskevichkarina@gmail.com>,
Alexander Lakhin <exclusion@gmail.com>, Michael Paquier <michael@paquier.xyz>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2023-07-11T22:46:16Z
Lists: pgsql-hackers
Em ter., 11 de jul. de 2023 às 19:34, Marko Tiikkaja <marko@joh.to> escreveu: > On Thu, Jul 6, 2023 at 5:37 PM Karina Litskevich > <litskevichkarina@gmail.com> wrote: > > My point is, technically right now you won't see any difference in output > > if you remove the line. Because if we get to that line the need_recordsep > > is already true. However, understanding why it is true is complicated. > That's > > why if you remove the line people who read the code will wonder why we > don't > > need a separator after "fputs"ing a footer. So keeping that line will > make > > the code more readable. > > Moreover, removing the line will possibly complicate the future > maintenance. > > As I wrote in the part you just quoted, if the function changes in the > way > > that need_recordsep is not true right before printing footers any more, > then > > output will be unexpected. > > I agree with Karina here. Either this patch should keep the > "need_recordsep = true;" line, thus removing the no-op assignment to > false and making the code slightly less unreadable; or the entire > function should be refactored for readability. > As there is consensus to keep the no-op assignment, I will go ahead and reject the patch. regards, Ranier Vilela