Hi,

In gistinitpage, pageSize variable looks redundant, instead we could
just pass BLCKSZ. This will be consistent with its peers
BloomInitPage, brin_page_init and SpGistInitPage. Attaching a small
patch. Thoughts?

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com
From b77d8d445ebf7c0a00b4931c0f346d2bffb64a61 Mon Sep 17 00:00:00 2001
From: Bharath Rupireddy <bharath.rupireddy@enterprisedb.com>
Date: Sun, 25 Apr 2021 19:51:06 +0530
Subject: [PATCH v1] Remove redundant variable pageSize in gistinitpage

In gistinitpage, pageSize variable looks redundant, instead just
pass BLCKSZ. This will be consistent with its peers BloomInitPage,
brin_page_init and SpGistInitPage.
---
 src/backend/access/gist/gistutil.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c
index 8dcd53c457..43ba03b6eb 100644
--- a/src/backend/access/gist/gistutil.c
+++ b/src/backend/access/gist/gistutil.c
@@ -756,9 +756,8 @@ void
 gistinitpage(Page page, uint32 f)
 {
 	GISTPageOpaque opaque;
-	Size		pageSize = BLCKSZ;
 
-	PageInit(page, pageSize, sizeof(GISTPageOpaqueData));
+	PageInit(page, BLCKSZ, sizeof(GISTPageOpaqueData));
 
 	opaque = GistPageGetOpaque(page);
 	opaque->rightlink = InvalidBlockNumber;
-- 
2.25.1

Reply via email to