diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-10-18 19:04:20 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-10-18 19:04:20 -0400 |
commit | dc5aeca168629183e64087b1147d3c2645e49ddc (patch) | |
tree | 0cb5c9d8fa34fe52b0dee3056e902a94d58a957b /src/backend/utils/cache | |
parent | 8f8d74647880ef53fc674498827b8b8e6c80d125 (diff) | |
download | postgresql-dc5aeca168629183e64087b1147d3c2645e49ddc.tar.gz postgresql-dc5aeca168629183e64087b1147d3c2645e49ddc.zip |
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.
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/catcache.c | 8 |
1 files changed, 3 insertions, 5 deletions
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++; |