pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Piotr Stefaniak <postgres@piotr-stefaniak.me>
Subject: pgindent && weirdness
Date: Tue, 14 Jan 2020 19:18:14 -0300
Message-ID: <20200114221814.GA19630@alvherre.pgsql> (raw)

I just ran pgindent over some patch, and noticed that this hunk ended up
in my working tree:

inline patch 1: src/backend/statistics/extended_stats.c (+2/-2 lines) download inline-1.patchdiff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c index 861a9148ed..fff54062b0 100644 --- a/src/backend/statistics/extended_stats.c +++ b/src/backend/statistics/extended_stats.c @@ -1405,13 +1405,13 @@ examine_opclause_expression(OpExpr *expr, Var **varp, Const **cstp, bool *varonl if (IsA(rightop, RelabelType)) rightop = (Node *) ((RelabelType *) rightop)->arg; - if (IsA(leftop, Var) && IsA(rightop, Const)) + if (IsA(leftop, Var) &&IsA(rightop, Const)) { var = (Var *) leftop; cst = (Const *) rightop; varonleft = true; } - else if (IsA(leftop, Const) && IsA(rightop, Var)) + else if (IsA(leftop, Const) &&IsA(rightop, Var)) { var = (Var *) rightop; cst = (Const *) leftop;
This seems a really strange change; this git grep '&&[^([:space:]]' -- *.c shows that we already have a dozen or so occurrences already. (That's ignoring execExprInterp.c's use of computed gotos.) I don't care all that much, but wanted to throw it out in case somebody is specifically interested in studying pgindent's logic, since the last round of changes has yielded excellent results. Thanks, -- Álvaro Herrera PostgreSQL Expert, https://www.2ndQuadrant.com/

view thread (51+ messages)  latest in thread

Message-ID: <20200114221814.GA19630@alvherre.pgsql>
Permalink:  ../20200114221814.GA19630@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200114221814.GA19630@alvherre.pgsql

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, postgres@piotr-stefaniak.me
  Subject: Re: pgindent && weirdness
  In-Reply-To: <20200114221814.GA19630@alvherre.pgsql>
  References: <20200114221814.GA19630@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox