Re: [COMMITTERS] pgsql: Remove dead assignment - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [COMMITTERS] pgsql: Remove dead assignment
Date
Msg-id 16440.1332791632@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Remove dead assignment  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: [COMMITTERS] pgsql: Remove dead assignment  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On mån, 2012-03-26 at 15:15 -0400, Tom Lane wrote:
>> I also do not think it does anything for readability for this call
>> of read_info() to be unexpectedly unlike all the others. 

> I do not think that it is good code quality to assign something to a
> variable and then assign something different to a variable later in the
> same function.

Well, that's a totally different issue, because if we had used a
different variable for the other purpose, this assignment would
still be dead and coverity would still be whinging about it, no?

The problem that I have with this change (and the similar ones you've
made elsewhere) is really that it's only chance that the code isn't
fetching anything from the result of read_info.  If we subsequently
wanted to change the logic so it did do that, we'd have to put back the
assignment.  That sort of code churn benefits nobody.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: Command Triggers, v16
Next
From: Robert Haas
Date:
Subject: Re: Command Triggers, v16