Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Aleksander Alekseev <aleksander@timescale.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-16T10:35:19Z
Lists: pgsql-hackers
On Tue, Apr 16, 2024 at 5:48 PM Aleksander Alekseev <
aleksander@timescale.com> wrote:

> Oversight of 0294df2f1f84 [1].
>
> [1]:
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=0294df2f1f84


+1.  I think this change improves the code quality.  I searched for
other arrays indexed by merge match kind, but found none.  So this patch
seems thorough.

Thanks
Richard

Commits

  1. Use macro to define the number of enum values

  2. Use macro NUM_MERGE_MATCH_KINDS instead of '3' in MERGE code.