v1-0001-Minor-refactor-in-catcache.c.patch
application/octet-stream
Filename: v1-0001-Minor-refactor-in-catcache.c.patch
Type: application/octet-stream
Part: 0
Message:
Minor refactor in catcache.c
From 6f8ca1dc9d23426fb4a3614049ed7524bac67e0d Mon Sep 17 00:00:00 2001
From: ChangAo Chen <cca5507@qq.com>
Date: Tue, 30 Dec 2025 19:38:32 +0800
Subject: [PATCH v1] Minor refactor in catcache.c
---
src/backend/utils/cache/catcache.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index 1d09c66ac95..8011be767aa 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -1010,7 +1010,7 @@ RehashCatCache(CatCache *cp)
dlist_foreach_modify(iter, &cp->cc_bucket[i])
{
CatCTup *ct = dlist_container(CatCTup, cache_elem, iter.cur);
- int hashIndex = HASH_INDEX(ct->hash_value, newnbuckets);
+ Index hashIndex = HASH_INDEX(ct->hash_value, newnbuckets);
dlist_delete(iter.cur);
dlist_push_head(&newbucket[hashIndex], &ct->cache_elem);
@@ -1048,7 +1048,7 @@ RehashCatCacheLists(CatCache *cp)
dlist_foreach_modify(iter, &cp->cc_lbucket[i])
{
CatCList *cl = dlist_container(CatCList, cache_elem, iter.cur);
- int hashIndex = HASH_INDEX(cl->hash_value, newnbuckets);
+ Index hashIndex = HASH_INDEX(cl->hash_value, newnbuckets);
dlist_delete(iter.cur);
dlist_push_head(&newbucket[hashIndex], &cl->cache_elem);
@@ -2039,8 +2039,7 @@ SearchCatCacheList(CatCache *cache,
#ifndef CATCACHE_FORCE_RELEASE
ct->dead &&
#endif
- ct->refcount == 0 &&
- (ct->c_list == NULL || ct->c_list->refcount == 0))
+ ct->refcount == 0)
CatCacheRemoveCTup(cache, ct);
}
--
2.34.1