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

From Peter Eisentraut
Subject Re: [COMMITTERS] pgsql: Remove dead assignment
Date
Msg-id 1332790159.3800.8.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Remove dead assignment  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [COMMITTERS] pgsql: Remove dead assignment  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On mån, 2012-03-26 at 15:15 -0400, Tom Lane wrote:
>     init_sequence(seq_relid, &elm, &seq_rel);
> -   seq = read_info(elm, seq_rel, &buf);
> +   read_info(elm, seq_rel, &buf);
> 
> 
> I have to object to this patch.  In the blind service of eliminating
> warnings from some tool or other, you will introduce warnings from
> other tools?  It's traditional for lint to complain about code that
> sometimes ignores the return value of a function, for instance.

Yes, but the return value is ignored in this case as well.  Just
assigning it doesn't change that.

> 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.  It is better, on the other hand, if a function call
looks different if what it's supposed to do is different.

But I don't want to get hung up on this.  I thought it was just an
oversight.



pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Command Triggers, v16
Next
From: Thom Brown
Date:
Subject: Re: Command Triggers, v16