Re: Improve readability by using designated initializers when possible

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: Improve readability by using designated initializers when possible
Date: 2024-02-23 09:59:53
Message-ID: CAGECzQTgMJQzS-OZzzbWyto-Nyzw8qS-9AvhZNgPvnOiX7VCsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 23 Feb 2024 at 02:57, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> Sorry, I was unclear. I was asking a question about the reason the
> ObjectClass and the object_classes[] array exist in the current code,
> it wasn't a direct question about your patch.

I did a bit of git spelunking and the reason seems to be that back in
2002 when this was introduced not all relation ids were compile time
constants and thus an array was initialized once at bootup. I totally
agree with you that these days there's no reason for the array. So I
now added a second patch that removes this array, instead of updating
it to use the designated initializer syntax.

Attachment Content-Type Size
v2-0001-Remove-unnecessary-object_classes-array.patch application/octet-stream 22.9 KB
v2-0002-Use-designated-initializer-syntax-to-improve-read.patch application/octet-stream 32.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-02-23 10:11:58 Re: Synchronizing slots from primary to standby
Previous Message Zhijie Hou (Fujitsu) 2024-02-23 09:46:00 RE: Synchronizing slots from primary to standby