Fix outdated comments in catcache.h

Started by cca550711 months ago4 messageshackers
Jump to latest
#1cca5507
cca5507@qq.com

Hi,

473182c9523afad10e9507145690d902a0bc7f04 add a hash table for CatCList, this has
made some comments outdated.

Attach a small patch to fix it.

--
Regards,
ChangAo Chen

Attachments:

v1-0001-Fix-outdated-comments-in-catcache.h.patchapplication/octet-stream; charset=utf-8; name=v1-0001-Fix-outdated-comments-in-catcache.h.patchDownload+1-5
#2David Rowley
dgrowleyml@gmail.com
In reply to: cca5507 (#1)
Re: Fix outdated comments in catcache.h

On Thu, 18 Dec 2025 at 19:29, cca5507 <cca5507@qq.com> wrote:

473182c9523afad10e9507145690d902a0bc7f04 add a hash table for CatCList, this has
made some comments outdated.

Attach a small patch to fix it.

I agree that the comment about not dividing them into hash buckets
seems outdated now.

- dlist_node cache_elem; /* list member of per-catcache list */
+ dlist_node cache_elem; /* list member of per-bucket list */

I'm not sure this is more informative. How about?

dlist_node cache_elem; /* member for CatCache.cc_lbucket[] dlist */

I also really wonder what the fascination with having lower-case
struct names with camelCased typedef names in this file... It's not
really clear if that comment should say "CatCache.cc_lbucket[]" or
"catcache.cc_lbucket[]". I find the latter clearer so used that.

David

#3cca5507
cca5507@qq.com
In reply to: David Rowley (#2)
Re: Fix outdated comments in catcache.h

Hi,

 - dlist_node cache_elem; /* list member of per-catcache list */
 + dlist_node cache_elem; /* list member of per-bucket list */

I'm not sure this is more informative. How about?

dlist_node cache_elem; /* member for CatCache.cc_lbucket[] dlist */

I also really wonder what the fascination with having lower-case
struct names with camelCased typedef names in this file... It's not
really clear if that comment should say "CatCache.cc_lbucket[]" or
"catcache.cc_lbucket[]". I find the latter clearer so used that.

Your suggestion looks better, and we also need to update the comment
of CatCTup.cache_elem.

--
Regards,
ChangAo Chen

#4David Rowley
dgrowleyml@gmail.com
In reply to: cca5507 (#3)
Re: Fix outdated comments in catcache.h

On Mon, 5 Jan 2026 at 22:43, cca5507 <cca5507@qq.com> wrote:

Your suggestion looks better, and we also need to update the comment
of CatCTup.cache_elem.

Ok, done.

David