From d93592851de58c375d0aa8d34c4860157d91c8b3 Mon Sep 17 00:00:00 2001 From: Georgy Shelkovy Date: Thu, 8 May 2025 09:16:04 +0500 Subject: [PATCH] optimize --- hypopg_index.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hypopg_index.c b/hypopg_index.c index 2585a9f..79e28d0 100644 --- a/hypopg_index.c +++ b/hypopg_index.c @@ -77,6 +77,11 @@ static Oid BLOOM_AM_OID = InvalidOid; #endif +#if PG_VERSION_NUM < 180000 +#define CompareType int16 +#define COMPARE_LT BTLessStrategyNumber +#endif + /*--- Variables exported ---*/ explain_get_index_name_hook_type prev_explain_get_index_name_hook; @@ -878,11 +883,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) Oid ltopr; Oid btopfamily; Oid btopcintype; -#if PG_VERSION_NUM >= 180000 CompareType btstrategy; -#else - int16 btstrategy; -#endif ltopr = get_opfamily_member(entry->opfamily[attn], entry->opcintype[attn], @@ -894,11 +895,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) &btopcintype, &btstrategy) && btopcintype == entry->opcintype[attn] && -#if PG_VERSION_NUM >= 180000 btstrategy == COMPARE_LT -#else - btstrategy == BTLessStrategyNumber -#endif ) { /* Successful mapping */