some code cleanup in index.c and indexcmds.c

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: some code cleanup in index.c and indexcmds.c
Date: 2023-08-16 06:04:46
Message-ID: 5ed89c69-f4e6-5dab-4003-63bde7460e5e@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is a patch set with some straightforward code cleanup in index.c
and indexcmds.c and some adjacent places.

First, I have added const qualifiers to all the function prototypes as
appropriate. This didn't require any additional casts or tricks.

Then, I have renamed some function arguments for clarity. For example,
several functions had an argument like

Oid *classObjectId

This is confusing in more than one way: The "class" is actually the
operator class, not the pg_class entry, and the argument is actually an
array, not a single value as the name would suggest. The amended version

const Oid *opclassIds

should be much clearer.

Also, about half the code in these files already used the better naming
system, so this change also makes everything within these files more
consistent.

Third, I removed some line breaks around the places that I touched
anyway. In some cases, with the renaming, the lines didn't seem that
long anymore to warrant a line break.

Attachment Content-Type Size
0001-Add-const-decorations.patch text/plain 22.5 KB
0002-Rename-some-function-arguments-for-better-clarity.patch text/plain 21.3 KB
0003-Some-vertical-reformatting.patch text/plain 4.8 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2023-08-16 06:12:16 Re: Extract numeric filed in JSONB more effectively
Previous Message Ajin Cherian 2023-08-16 05:34:57 Re: Synchronizing slots from primary to standby