Hashtable: use appropriate return type for nextPrime

The return value is guaranteed to be smaller than SIZE_MAX, so return
size_t (matters on 32 bit architectures).
This commit is contained in:
Christian Göttsche 2021-01-12 16:37:43 +01:00
parent 2b62126aea
commit 66dd77aa6b
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ static const uint64_t OEISprimes[] = {
34359738337, 68719476731, 137438953447
};
static uint64_t nextPrime(size_t n) {
static size_t nextPrime(size_t n) {
/* on 32-bit make sure we do not return primes not fitting in size_t */
for (size_t i = 0; i < ARRAYSIZE(OEISprimes) && OEISprimes[i] < SIZE_MAX; i++) {
if (n <= OEISprimes[i])