Re: improve FOUND in PL/PgSQL

From: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: improve FOUND in PL/PgSQL
Date: 2002-08-14 23:23:31
Message-ID: 877kit81os.fsf@klamath.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> writes:
> > Ah, ok -- thanks for the suggestion. It required a fair amount of
> > work, since I had to refactor a lot of the logic in the 3 functions
> > that handle PL/PgSQL FOR loops.
>
> Then you're still doing it the hard way: all you need is to do
> exec_set_found(found) immediately before anyplace that's going to
> return. You don't need to move the returns.

Sure -- but those functions returned in six or seven different
places, and I thought that adding identical code to each location
would be too ugly.

> Perhaps the refactoring is worth doing anyway, if it improves the
> readability of the code; but if it makes it worse then there's no need.
> It's hard to tell about this just from looking at the diff --- what
> do you feel about what you did?

Personally, I think my changes improve readability.

Cheers,

Neil

--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-08-14 23:35:56 Re: improve FOUND in PL/PgSQL
Previous Message Tom Lane 2002-08-14 23:10:34 Re: improve FOUND in PL/PgSQL