Merge pull request #14699 from taosdata/fix/tdb-hash-negative
fix: use uint32_t instead of int to avoid negative hash result
This commit is contained in:
commit
19922cacf3
|
@ -259,7 +259,7 @@ static void tdbPCacheUnpinPage(SPCache *pCache, SPage *pPage) {
|
||||||
|
|
||||||
static void tdbPCacheRemovePageFromHash(SPCache *pCache, SPage *pPage) {
|
static void tdbPCacheRemovePageFromHash(SPCache *pCache, SPage *pPage) {
|
||||||
SPage **ppPage;
|
SPage **ppPage;
|
||||||
int h;
|
uint32_t h;
|
||||||
|
|
||||||
h = tdbPCachePageHash(&(pPage->pgid));
|
h = tdbPCachePageHash(&(pPage->pgid));
|
||||||
for (ppPage = &(pCache->pgHash[h % pCache->nHash]); (*ppPage) && *ppPage != pPage; ppPage = &((*ppPage)->pHashNext))
|
for (ppPage = &(pCache->pgHash[h % pCache->nHash]); (*ppPage) && *ppPage != pPage; ppPage = &((*ppPage)->pHashNext))
|
||||||
|
|
Loading…
Reference in New Issue