8000 Fix type of iterator variable in SH_START_ITERATE · postgres/postgres@6143602 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6143602

Browse files
committed
Fix type of iterator variable in SH_START_ITERATE
Also add comment to make the reasoning behind the Assert() more explicit (per Tom). Reported-by: Ranier Vilela Discussion: https://postgr.es/m/CAEudQAocXNJ6s1VLz+hMamLAQAiewRoW17OJ6-+9GACKfj6iPQ@mail.gmail.com Backpatch: 11-
1 parent 2e99ce6 commit 6143602

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/include/lib/simplehash.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ SH_DELETE(SH_TYPE * tb, SH_KEY_TYPE key)
760760
SH_SCOPE void
761761
SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
762762
{
763-
int i;
763+
uint32 i;
764764
uint64 startelem = PG_UINT64_MAX;
765765

766766
/*
@@ -779,6 +779,7 @@ SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
779779
}
780780
}
781781

782+
/* we should have found an empty element */
782783
Assert(startelem < SH_MAX_SIZE);
783784

784785
/*

0 commit comments

Comments
 (0)
0