Re: [PATCH] Replace a long chain of if's in eval_const_expressions_mutator by a switch()

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Replace a long chain of if's in eval_const_expressions_mutator by a switch()
Date: 2011-11-18 21:45:31
Message-ID: 201111182245.31216.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday, November 18, 2011 10:14:22 PM Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > For unknown reasons the function used non chained ifs for every handled
> > nodeType.
> > Replacing the if chain with if; else if; ... resulted in a small
> > speedup. Replacing it with a switch() in a bigger one.
>
> Cool, but this patch is impossible to validate by eye. Could you
> resubmit a version that doesn't reindent unchanged code? Leave it
> for pgindent to clean that up later.
Sure. It was just to confusing reading the code without reindenting.

Btw, I found git diff/show/blame -w very useful to view reindent code.

Actually git show -w seems to produce an applyable patch which doesn't
reindent...

Andres

Attachment Content-Type Size
noreindent-0001-Replace-a-long-chain-of-if-s-in-eval_const_expressio.patch text/x-patch 5.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-11-18 22:06:00 Re: Materialized views
Previous Message Andres Freund 2011-11-18 21:39:40 Re: RFC: list API / memory allocations