[dynahash] do not refill the hashkey after hash_search - Mailing list pgsql-hackers

From Junwang Zhao
Subject [dynahash] do not refill the hashkey after hash_search
Date
Msg-id CAEG8a3+UPF=R2QGPgJMF2mKh8xPd1H2TmfH77zPuVUFdBpiGUA@mail.gmail.com
Whole thread Raw
Responses Re: [dynahash] do not refill the hashkey after hash_search
List pgsql-hackers
Hi hackers,

It's not necessary to fill the key field for most cases, since
hash_search has already done that for you. For developer that
using memset to zero the entry structure after enter it, fill the
key field is a must, but IMHO that is not good coding style, we
really should not touch the key field after insert it into the
dynahash.

This patch fixed some most abnormal ones, instead of refilling the
key field of primitive types, adding some assert might be a better
choice.


-- 
Regards
Junwang Zhao

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_upgrade and logical replication
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows