From dc5aeca168629183e64087b1147d3c2645e49ddc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 18 Oct 2012 19:04:20 -0400 Subject: Remove unnecessary "head" arguments from some dlist/slist functions. dlist_delete, dlist_insert_after, dlist_insert_before, slist_insert_after do not need access to the list header, and indeed insisting on that negates one of the main advantages of a doubly-linked list. In consequence, revert addition of "cache_bucket" field to CatCTup. --- src/backend/utils/cache/catcache.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/backend/utils/cache') diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 05ceff51cdf..a293f570e1b 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -370,7 +370,7 @@ CatCacheRemoveCTup(CatCache *cache, CatCTup *ct) return; /* nothing left to do */ } - dlist_delete(ct->cache_bucket, &ct->cache_elem); + dlist_delete(&ct->cache_elem); /* free associated tuple data */ if (ct->tuple.t_data != NULL) @@ -413,7 +413,7 @@ CatCacheRemoveCList(CatCache *cache, CatCList *cl) } /* delink from linked list */ - dlist_delete(&cache->cc_lists, &cl->cache_elem); + dlist_delete(&cl->cache_elem); /* free associated tuple data */ if (cl->tuple.t_data != NULL) @@ -1664,15 +1664,13 @@ CatalogCacheCreateEntry(CatCache *cache, HeapTuple ntp, */ ct->ct_magic = CT_MAGIC; ct->my_cache = cache; - ct->cache_bucket = &cache->cc_bucket[hashIndex]; - ct->c_list = NULL; ct->refcount = 0; /* for the moment */ ct->dead = false; ct->negative = negative; ct->hash_value = hashValue; - dlist_push_head(ct->cache_bucket, &ct->cache_elem); + dlist_push_head(&cache->cc_bucket[hashIndex], &ct->cache_elem); cache->cc_ntup++; CacheHdr->ch_ntup++; -- cgit v1.2.3