Skip site navigation (1) Skip section navigation (2)

Re: [COMMITTERS] pgsql: Remove dead assignment

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Remove dead assignment
Date: 2012-03-26 19:53:52
Message-ID: 16440.1332791632@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On mn, 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

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2012-03-26 20:05:42
Subject: Re: Command Triggers, v16
Previous:From: Thom BrownDate: 2012-03-26 19:36:40
Subject: Re: Command Triggers, v16

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-03-27 17:40:30
Subject: pgsql: pg_dump: Small message adjustment for consistency
Previous:From: Peter EisentrautDate: 2012-03-26 19:29:19
Subject: Re: [COMMITTERS] pgsql: Remove dead assignment

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group