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

Commit9f23619

Browse files
committed
Fix type of iterator variable in SH_START_ITERATE
Also add comment to make the reasoning behind the Assert() more explicit (perTom).Reported-by: Ranier VilelaDiscussion:https://postgr.es/m/CAEudQAocXNJ6s1VLz+hMamLAQAiewRoW17OJ6-+9GACKfj6iPQ@mail.gmail.comBackpatch: 11-
1 parent2d3983a commit9f23619

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/include/lib/simplehash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,15 +772,14 @@ SH_DELETE(SH_TYPE * tb, SH_KEY_TYPE key)
772772
SH_SCOPEvoid
773773
SH_START_ITERATE(SH_TYPE*tb,SH_ITERATOR*iter)
774774
{
775-
inti;
776775
uint64startelem=PG_UINT64_MAX;
777776

778777
/*
779778
* Search for the first empty element. As deletions during iterations are
780779
* supported, we want to start/end at an element that cannot be affected
781780
* by elements being shifted.
782781
*/
783-
for (i=0;i<tb->size;i++)
782+
for (uint32i=0;i<tb->size;i++)
784783
{
785784
SH_ELEMENT_TYPE*entry=&tb->data[i];
786785

@@ -791,6 +790,7 @@ SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
791790
}
792791
}
793792

793+
/* we should have found an empty element */
794794
Assert(startelem<SH_MAX_SIZE);
795795

796796
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp