From: | Matthew Kirkwood <matthew(at)hairy(dot)beasts(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | The Hermit Hacker <scrappy(at)hub(dot)org>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: Small xlog.c cleanup |
Date: | 2001-02-27 21:12:41 |
Message-ID: | Pine.LNX.4.10.10102272104310.4651-100000@sphinx.mythic-beasts.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
On Tue, 27 Feb 2001, Tom Lane wrote:
> > He's moved the "static globals" from around line 286 of
> > src/backend/access/transam/xlog.c:
> > to be static locals inside of function ReadRecord around line 1216 in the
> > same file:
>
> This is not usual coding practice in Postgres, so far as I've noticed.
>
> I prefer to avoid static locals because the fact that they *are*
> static is easily missed. In particular it's way too easy to misread
> the initialization as something that happens on every entry to the
> function, rather than only once. So my opinion is that this change is
> bad style.
Fair enough. I just found it even more confusing that they were
defined almost 1KLOC from their only use.
But functions of 300LOC tend to fail my taste guidelines too, so
perhaps I should leave well alone :)
Matthew.
From | Date | Subject | |
---|---|---|---|
Next Message | Matthew Kirkwood | 2001-02-27 22:20:57 | Re: mmap for zeroing WAL log |
Previous Message | Bruce Momjian | 2001-02-27 20:55:21 | Re: Small xlog.c cleanup |