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

Commit09391dd

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 parent9ebe6fd commit09391dd

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
@@ -840,15 +840,14 @@ SH_DELETE(SH_TYPE * tb, SH_KEY_TYPE key)
840840
SH_SCOPEvoid
841841
SH_START_ITERATE(SH_TYPE*tb,SH_ITERATOR*iter)
842842
{
843-
inti;
844843
uint64startelem=PG_UINT64_MAX;
845844

846845
/*
847846
* Search for the first empty element. As deletions during iterations are
848847
* supported, we want to start/end at an element that cannot be affected
849848
* by elements being shifted.
850849
*/
851-
for (i=0;i<tb->size;i++)
850+
for (uint32i=0;i<tb->size;i++)
852851
{
853852
SH_ELEMENT_TYPE*entry=&tb->data[i];
854853

@@ -859,6 +858,7 @@ SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
859858
}
860859
}
861860

861+
/* we should have found an empty element */
862862
Assert(startelem<SH_MAX_SIZE);
863863

864864
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp