Re: [HACKERS] Why assignment before return?

2010-08-20 Thread Magnus Hagander
On Fri, Aug 20, 2010 at 15:27, Tom Lane wrote: > Magnus Hagander writes: >> I see your answer as "no, not really any reason, but also not worth >> changing", which is fine by me :-) > > Yeah, that's a fair summary.  If it had been coded the other way > to start with, I'd also say it wasn't worth

Re: [HACKERS] Why assignment before return?

2010-08-20 Thread Tom Lane
Magnus Hagander writes: > I see your answer as "no, not really any reason, but also not worth > changing", which is fine by me :-) Yeah, that's a fair summary. If it had been coded the other way to start with, I'd also say it wasn't worth changing, at least not until such time as we actually nee

Re: [HACKERS] Why assignment before return?

2010-08-20 Thread Magnus Hagander
On Fri, Aug 20, 2010 at 15:10, Tom Lane wrote: > Magnus Hagander writes: >> This code-pattern appears many times in pgstatfuncs.c: >> Datum >> pg_stat_get_blocks_fetched(PG_FUNCTION_ARGS) >> { >>       Oid                     relid = PG_GETARG_OID(0); >>       int64           result; >>       PgS

Re: [HACKERS] Why assignment before return?

2010-08-20 Thread Tom Lane
Magnus Hagander writes: > This code-pattern appears many times in pgstatfuncs.c: > Datum > pg_stat_get_blocks_fetched(PG_FUNCTION_ARGS) > { > Oid relid = PG_GETARG_OID(0); > int64 result; > PgStat_StatTabEntry *tabentry; > if ((tabentry = pgst

Re: [HACKERS] Why assignment before return?

2010-08-20 Thread Thom Brown
On 20 August 2010 12:46, Magnus Hagander wrote: > This code-pattern appears many times in pgstatfuncs.c: > > Datum > pg_stat_get_blocks_fetched(PG_FUNCTION_ARGS) > { >        Oid                     relid = PG_GETARG_OID(0); >        int64           result; >        PgStat_StatTabEntry *tabentry;

[HACKERS] Why assignment before return?

2010-08-20 Thread Magnus Hagander
This code-pattern appears many times in pgstatfuncs.c: Datum pg_stat_get_blocks_fetched(PG_FUNCTION_ARGS) { Oid relid = PG_GETARG_OID(0); int64 result; PgStat_StatTabEntry *tabentry; if ((tabentry = pgstat_fetch_stat_tabentry(relid)) =