summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistbuildbuffers.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2022-08-26 02:46:56 +1200
committerDavid Rowley <drowley@postgresql.org>2022-08-26 02:46:56 +1200
commitd389487525bc1d543f27543ed2ff824d3a30f508 (patch)
tree20202e8ff11874fcefb2941e369877ede0e33a33 /src/backend/access/gist/gistbuildbuffers.c
parent3e0fff2e6888e39b0ad5cdfdb78bc1c2bb2b22c9 (diff)
downloadpostgresql-d389487525bc1d543f27543ed2ff824d3a30f508.tar.gz
Small refactor to get rid of -Wshadow=compatible-local warning
Further reduce -Wshadow=compatible-local warnings by 1 by refactoring the code in gistRelocateBuildBuffersOnSplit() to make use of foreach_current_index() instead of manually incrementing a variable on each loop. Author: David Rowley Discussion: https://postgr.es/m/CAApHDvpGZX-X=Bn4moyXgfFa0CdSUwoa04d3isit3=1qo8F8Bw@mail.gmail.com
Diffstat (limited to 'src/backend/access/gist/gistbuildbuffers.c')
-rw-r--r--src/backend/access/gist/gistbuildbuffers.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c
index eabf746018..c6c7dfe4c2 100644
--- a/src/backend/access/gist/gistbuildbuffers.c
+++ b/src/backend/access/gist/gistbuildbuffers.c
@@ -543,8 +543,7 @@ gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
GISTNodeBuffer *nodeBuffer;
BlockNumber blocknum;
IndexTuple itup;
- int splitPagesCount = 0,
- i;
+ int splitPagesCount = 0;
GISTENTRY entry[INDEX_MAX_KEYS];
bool isnull[INDEX_MAX_KEYS];
GISTNodeBuffer oldBuf;
@@ -595,11 +594,11 @@ gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
* Fill relocation buffers information for node buffers of pages produced
* by split.
*/
- i = 0;
foreach(lc, splitinfo)
{
GISTPageSplitInfo *si = (GISTPageSplitInfo *) lfirst(lc);
GISTNodeBuffer *newNodeBuffer;
+ int i = foreach_current_index(lc);
/* Decompress parent index tuple of node buffer page. */
gistDeCompressAtt(giststate, r,
@@ -618,8 +617,6 @@ gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
relocationBuffersInfos[i].nodeBuffer = newNodeBuffer;
relocationBuffersInfos[i].splitinfo = si;
-
- i++;
}
/*