Move fixed value to struct initializer

This commit is contained in:
Andreas Karlsson 2025-04-02 00:55:07 +02:00 committed by Andreas Karlsson
parent d67ad2ab90
commit 79c8372d2d

View File

@ -79,6 +79,9 @@ static dshash_parameters principal_key_dsh_params = {
.entry_size = sizeof(TDEPrincipalKey),
.compare_function = dshash_memcmp,
.hash_function = dshash_memhash,
#if PG_VERSION_NUM >= 170000
.copy_function = dshash_memcpy,
#endif
};
static TdePrincipalKeylocalState principalKeyLocalState;
@ -189,9 +192,6 @@ initialize_objects_in_dsa_area(dsa_area *dsa, void *raw_dsa_area)
sharedState->rawDsaArea = raw_dsa_area;
sharedState->hashTrancheId = LWLockNewTrancheId();
principal_key_dsh_params.tranche_id = sharedState->hashTrancheId;
#if PG_VERSION_NUM >= 170000
principal_key_dsh_params.copy_function = dshash_memcpy;
#endif
dsh = dshash_create(dsa, &principal_key_dsh_params, 0);
sharedState->hashHandle = dshash_get_hash_table_handle(dsh);
dshash_detach(dsh);