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

Commit1508b57

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 parentfb0f055 commit1508b57

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
@@ -965,15 +965,14 @@ SH_DELETE_ITEM(SH_TYPE * tb, SH_ELEMENT_TYPE * entry)
965965
SH_SCOPEvoid
966966
SH_START_ITERATE(SH_TYPE*tb,SH_ITERATOR*iter)
967967
{
968-
inti;
969968
uint64startelem=PG_UINT64_MAX;
970969

971970
/*
972971
* Search for the first empty element. As deletions during iterations are
973972
* supported, we want to start/end at an element that cannot be affected
974973
* by elements being shifted.
975974
*/
976-
for (i=0;i<tb->size;i++)
975+
for (uint32i=0;i<tb->size;i++)
977976
{
978977
SH_ELEMENT_TYPE*entry=&tb->data[i];
979978

@@ -984,6 +983,7 @@ SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
984983
}
985984
}
986985

986+
/* we should have found an empty element */
987987
Assert(startelem<SH_MAX_SIZE);
988988

989989
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp