Re: Replace magic numbers with strategy numbers for B-tree indexes
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Daniil Davydov <3danissimo@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-06-30T03:25:45Z
Lists: pgsql-hackers
On Mon, Jun 30, 2025 at 8:51 AM Daniil Davydov <3danissimo@gmail.com> wrote: > > Hi, > I noticed that some asserts and cycles use magic numbers 1 and 0 > instead of BTLessStrategyNumber and InvalidStrategy. > At the same time, the BTMaxStrategyNumber macro is used there. > I suggest using appropriate macros for 1 and 0 values. > > Please, see attached patch (targeted on the master branch). IMHO, it makes sense to use macros when it's already present for consistency. So +1 or making this change and the attached patch LGTM -- Regards, Dilip Kumar Google