Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd389487

Browse files
committed
Small refactor to get rid of -Wshadow=compatible-local warning
Further reduce -Wshadow=compatible-local warnings by 1 by refactoring thecode in gistRelocateBuildBuffersOnSplit() to make use offoreach_current_index() instead of manually incrementing a variable oneach loop.Author: David RowleyDiscussion:https://postgr.es/m/CAApHDvpGZX-X=Bn4moyXgfFa0CdSUwoa04d3isit3=1qo8F8Bw@mail.gmail.com
1 parent3e0fff2 commitd389487

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

‎src/backend/access/gist/gistbuildbuffers.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,7 @@ gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
543543
GISTNodeBuffer*nodeBuffer;
544544
BlockNumberblocknum;
545545
IndexTupleitup;
546-
intsplitPagesCount=0,
547-
i;
546+
intsplitPagesCount=0;
548547
GISTENTRYentry[INDEX_MAX_KEYS];
549548
boolisnull[INDEX_MAX_KEYS];
550549
GISTNodeBufferoldBuf;
@@ -595,11 +594,11 @@ gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
595594
* Fill relocation buffers information for node buffers of pages produced
596595
* by split.
597596
*/
598-
i=0;
599597
foreach(lc,splitinfo)
600598
{
601599
GISTPageSplitInfo*si= (GISTPageSplitInfo*)lfirst(lc);
602600
GISTNodeBuffer*newNodeBuffer;
601+
inti=foreach_current_index(lc);
603602

604603
/* Decompress parent index tuple of node buffer page. */
605604
gistDeCompressAtt(giststate,r,
@@ -618,8 +617,6 @@ gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
618617

619618
relocationBuffersInfos[i].nodeBuffer=newNodeBuffer;
620619
relocationBuffersInfos[i].splitinfo=si;
621-
622-
i++;
623620
}
624621

625622
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp