Re: REVIEW: patch: remove redundant code from pl_exec.c

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: REVIEW: patch: remove redundant code from pl_exec.c
Date: 2011-01-20 07:55:20
Message-ID: AANLkTi=UxkacsoR9EiuB3O6w0A3AkpWQqCGJ6hSYoCyO@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/1/19 Stephen Frost <sfrost(at)snowman(dot)net>:
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> I think we should reject this one.
>
> Works for me.
>
>> Using a switch there is a bit problematic since in some cases you want
>> to use "break" to exit the loop.  We could replace such breaks by gotos,
>> but that would be another strike against the argument that you're making
>> things more readable.  I think the switch in exec_stmt_loop is only
>> workable because it has no cleanup to do, so it can just "return" in
>> places where a loop break would otherwise be needed.  In short: if you
>> want to make these all look alike, better to go the other way.
>
> Ah, yeah, good point.  We do use gotos elsewhere for this reason, might
> consider revisiting those also, if we're trying to a 'clean-up' patch.
> In any case, I'll mark this as rejected.

ok, I don't thinking so current code is readable, but I can't to do better now.

Thank you for review.

Regards

Pavel Stehule

>
>        Thanks!
>
>                Stephen
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk03S10ACgkQrzgMPqB3kigWdQCeIU/dvgJ8bMVZ7nh+TYiFHVlP
> 4H4AnR/JbboMWbCu95G2aUEcP3LZDDGM
> =R8c6
> -----END PGP SIGNATURE-----
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-01-20 08:10:22 Re: estimating # of distinct values
Previous Message Heikki Linnakangas 2011-01-20 07:36:47 Re: SSI and Hot Standby