some code cleanup in index.c and indexcmds.c

Started by Peter Eisentrautover 2 years ago1 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

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.

Attachments:

0001-Add-const-decorations.patchtext/plain; charset=UTF-8; name=0001-Add-const-decorations.patchDownload+94-95
0002-Rename-some-function-arguments-for-better-clarity.patchtext/plain; charset=UTF-8; name=0002-Rename-some-function-arguments-for-better-clarity.patchDownload+92-93
0003-Some-vertical-reformatting.patchtext/plain; charset=UTF-8; name=0003-Some-vertical-reformatting.patchDownload+12-22