Re: useless assignment pointer argument

From: Andres Freund <andres(at)anarazel(dot)de>
To: Gaetano Mendola <mendola(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: useless assignment pointer argument
Date: 2015-05-28 20:17:00
Message-ID: 20150528201659.GA26821@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-05-28 20:14:33 +0000, Gaetano Mendola wrote:
> src/backend/commands/explain.c:1692
> src/backend/commands/explain.c:1874
> src/backend/commands/explain.c:1986
>
> there is the following assignment:
>
> ancestors = list_delete_first(ancestors);
>
> but it has no effect at all being that a function parameter and not used
> anymore after the assignment itself.

So? It costs little to nothing, and it'll make it much less likely that
a stale version of 'ancestors' is used when the code is expanded.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2015-05-28 20:22:09 Re: RFC: Remove contrib entirely
Previous Message Gaetano Mendola 2015-05-28 20:14:33 useless assignment pointer argument