Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

2024-04-22 Thread Dean Rasheed
On Mon, 22 Apr 2024 at 06:04, Michael Paquier wrote: > > On Fri, Apr 19, 2024 at 12:47:43PM +0300, Aleksander Alekseev wrote: > > Thanks. I see a few pieces of code that use special FOO_NUMBER enum > > values instead of a macro. Should we refactor these pieces > > accordingly? PFA another patch.

Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

2024-04-21 Thread Michael Paquier
On Fri, Apr 19, 2024 at 12:47:43PM +0300, Aleksander Alekseev wrote: > Thanks. I see a few pieces of code that use special FOO_NUMBER enum > values instead of a macro. Should we refactor these pieces > accordingly? PFA another patch. I don't see why not for the places you are changing here, we

Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

2024-04-19 Thread Aleksander Alekseev
Hi, > > Fair point. PFA the alternative version of the patch. > > > > Thanks. Committed. Thanks. I see a few pieces of code that use special FOO_NUMBER enum values instead of a macro. Should we refactor these pieces accordingly? PFA another patch. -- Best regards, Aleksander Alekseev

Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

2024-04-19 Thread Dean Rasheed
On Thu, 18 Apr 2024 at 13:00, Aleksander Alekseev wrote: > > Fair point. PFA the alternative version of the patch. > Thanks. Committed. Regards, Dean

Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

2024-04-18 Thread Aleksander Alekseev
Hi, > I guess the argument against inserting an enum element at the end is > that a switch statement on the enum value might generate a compiler > warning if it didn't have a default clause. Fair point. PFA the alternative version of the patch. -- Best regards, Aleksander Alekseev

Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

2024-04-16 Thread Dean Rasheed
On Tue, 16 Apr 2024 at 11:35, Richard Guo wrote: > > On Tue, Apr 16, 2024 at 5:48 PM Aleksander Alekseev > 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

Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

2024-04-16 Thread Richard Guo
On Tue, Apr 16, 2024 at 5:48 PM Aleksander Alekseev < aleksan...@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

[PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

2024-04-16 Thread Aleksander Alekseev
Oversight of 0294df2f1f84 [1]. [1]: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=0294df2f1f84 -- Best regards, Aleksander Alekseev v1-0001-Replace-constant-3-with-NUM_MERGE_MATCH_KINDS.patch Description: Binary data