public inbox for [email protected]
help / color / mirror / Atom feedFrom: Kyotaro Horiguchi <[email protected]>
Subject: [PATCH 5/5] Adjust indentation of SearchCatCacheInternal
Date: Mon, 1 Jul 2019 14:11:08 +0900
The previous patch leaves indentation of an existing code block in
SearchCatCacheInternal unchanged for diff size to be small. This
adjusts the indentation.
---
src/backend/utils/cache/catcache.c | 82 +++++++++++++++++++-------------------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index b552ae960c..60d0fd28a8 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -1376,59 +1376,59 @@ SearchCatCacheInternal(CatCache *cache,
*/
if (likely(catalog_cache_prune_min_age < 0))
{
- dlist_foreach(iter, bucket)
- {
- ct = dlist_container(CatCTup, cache_elem, iter.cur);
-
- if (ct->dead)
- continue; /* ignore dead entries */
-
- if (ct->hash_value != hashValue)
- continue; /* quickly skip entry if wrong hash val */
-
- if (!CatalogCacheCompareTuple(cache, nkeys, ct->keys, arguments))
- continue;
-
- /*
- * We found a match in the cache. Move it to the front of the list
- * for its hashbucket, in order to speed subsequent searches. (The
- * most frequently accessed elements in any hashbucket will tend to be
- * near the front of the hashbucket's list.)
- */
- dlist_move_head(bucket, &ct->cache_elem);
-
- /*
- * If it's a positive entry, bump its refcount and return it. If it's
- * negative, we can report failure to the caller.
- */
- if (!ct->negative)
+ dlist_foreach(iter, bucket)
{
- ResourceOwnerEnlargeCatCacheRefs(CurrentResourceOwner);
- ct->refcount++;
- ResourceOwnerRememberCatCacheRef(CurrentResourceOwner, &ct->tuple);
+ ct = dlist_container(CatCTup, cache_elem, iter.cur);
- CACHE_elog(DEBUG2, "SearchCatCache(%s): found in bucket %d",
- cache->cc_relname, hashIndex);
+ if (ct->dead)
+ continue; /* ignore dead entries */
+
+ if (ct->hash_value != hashValue)
+ continue; /* quickly skip entry if wrong hash val */
+
+ if (!CatalogCacheCompareTuple(cache, nkeys, ct->keys, arguments))
+ continue;
+
+ /*
+ * We found a match in the cache. Move it to the front of the
+ * list for its hashbucket, in order to speed subsequent searches.
+ * (The most frequently accessed elements in any hashbucket will
+ * tend to be near the front of the hashbucket's list.)
+ */
+ dlist_move_head(bucket, &ct->cache_elem);
+
+ /*
+ * If it's a positive entry, bump its refcount and return it. If
+ * it's negative, we can report failure to the caller.
+ */
+ if (!ct->negative)
+ {
+ ResourceOwnerEnlargeCatCacheRefs(CurrentResourceOwner);
+ ct->refcount++;
+ ResourceOwnerRememberCatCacheRef(CurrentResourceOwner, &ct->tuple);
+
+ CACHE_elog(DEBUG2, "SearchCatCache(%s): found in bucket %d",
+ cache->cc_relname, hashIndex);
#ifdef CATCACHE_STATS
- cache->cc_hits++;
+ cache->cc_hits++;
#endif
- return &ct->tuple;
- }
- else
- {
- CACHE_elog(DEBUG2, "SearchCatCache(%s): found neg entry in bucket %d",
- cache->cc_relname, hashIndex);
+ return &ct->tuple;
+ }
+ else
+ {
+ CACHE_elog(DEBUG2, "SearchCatCache(%s): found neg entry in bucket %d",
+ cache->cc_relname, hashIndex);
#ifdef CATCACHE_STATS
- cache->cc_neg_hits++;
+ cache->cc_neg_hits++;
#endif
- return NULL;
+ return NULL;
+ }
}
}
- }
else
{
/*
--
2.16.3
----Next_Part(Mon_Jul_01_16_02_59_2019_106)----
view thread (992+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH 5/5] Adjust indentation of SearchCatCacheInternal
In-Reply-To: <no-message-id-1881946@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox