Re: Copypasta in the PostgreSQL source

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Copypasta in the PostgreSQL source
Date: 2018-12-17 22:35:23
Message-ID: 20181217223523.csclh5hoixac5bys@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Dec-17, Tom Lane wrote:

> David Fetter <david(at)fetter(dot)org> writes:
> > Please find attached a run of a tool that looks for duplicated tokens.
> > I've removed some things that seem like false positives, basically all
> > from the stemmer part of the source, but there's still a lot.
>
> I thought you were talking about problems like "that that" typos,
> but on looking at the file, what this is actually complaining
> about is any duplicated code segments anywhere. I do not find
> this helpful. Refactoring to the point that dozen-line code
> stanzas never appear more than once would be incredibly invasive,
> likely very bad for performance, and I don't think it'd improve
> readability either.

Agreed. Skimming the report, we get some very silly duplications, such
as a function definition duplicating its prototype.

I agree that this is mostly unhelpful noise and we shouldn't spend too
much time on it.

On the other hand, I'm not clear on why do we need four copies of
number_of_ones.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2018-12-17 22:37:16 Re: 'infinity'::Interval should be added
Previous Message Tom Lane 2018-12-17 22:31:22 Re: Copypasta in the PostgreSQL source