We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fa25ce commit f0a94d8Copy full SHA for f0a94d8
src/include/lib/simplehash.h
@@ -964,15 +964,14 @@ SH_DELETE_ITEM(SH_TYPE * tb, SH_ELEMENT_TYPE * entry)
964
SH_SCOPE void
965
SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
966
{
967
- int i;
968
uint64 startelem = PG_UINT64_MAX;
969
970
/*
971
* Search for the first empty element. As deletions during iterations are
972
* supported, we want to start/end at an element that cannot be affected
973
* by elements being shifted.
974
*/
975
- for (i = 0; i < tb->size; i++)
+ for (uint32 i = 0; i < tb->size; i++)
976
977
SH_ELEMENT_TYPE *entry = &tb->data[i];
978
@@ -983,6 +982,7 @@ SH_START_ITERATE(SH_TYPE * tb, SH_ITERATOR * iter)
983
982
}
984
985
+ /* we should have found an empty element */
986
Assert(startelem < SH_MAX_SIZE);
987
988
0 commit comments