Re: useless assignment pointer argument

From: Gaetano Mendola <mendola(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: useless assignment pointer argument
Date: 2015-05-28 20:42:37
Message-ID: CAJycT5o4iL+1JwzkwyUfv9YVYiPOCzO1b2O+auxp-Zq93DzKjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

If the compiler is good the assignment is elided indeed, that's not what I
meant to point out.

On Thu, 28 May 2015 at 22:17 Andres Freund <andres(at)anarazel(dot)de> wrote:

> 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2015-05-28 20:42:54 Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx
Previous Message Gaetano Mendola 2015-05-28 20:35:17 Re: Possible pointer dereference