mirror of
https://github.com/postgres/postgres.git
synced 2025-11-18 02:02:55 +03:00
Fix various hash function uses
These instances were using Datum-returning functions where a lower-level function returning uint32 would be more appropriate. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/8246d7ff-f4b7-4363-913e-827dadfeb145%40eisentraut.org
This commit is contained in:
@@ -2833,7 +2833,7 @@ hash_multirange(PG_FUNCTION_ARGS)
|
||||
upper_hash = 0;
|
||||
|
||||
/* Merge hashes of flags and bounds */
|
||||
range_hash = hash_uint32((uint32) flags);
|
||||
range_hash = hash_bytes_uint32((uint32) flags);
|
||||
range_hash ^= lower_hash;
|
||||
range_hash = pg_rotate_left32(range_hash, 1);
|
||||
range_hash ^= upper_hash;
|
||||
|
||||
@@ -1444,7 +1444,7 @@ hash_range(PG_FUNCTION_ARGS)
|
||||
upper_hash = 0;
|
||||
|
||||
/* Merge hashes of flags and bounds */
|
||||
result = hash_uint32((uint32) flags);
|
||||
result = hash_bytes_uint32((uint32) flags);
|
||||
result ^= lower_hash;
|
||||
result = pg_rotate_left32(result, 1);
|
||||
result ^= upper_hash;
|
||||
|
||||
2
src/backend/utils/cache/catcache.c
vendored
2
src/backend/utils/cache/catcache.c
vendored
@@ -213,7 +213,7 @@ namehashfast(Datum datum)
|
||||
{
|
||||
char *key = NameStr(*DatumGetName(datum));
|
||||
|
||||
return hash_any((unsigned char *) key, strlen(key));
|
||||
return hash_bytes((unsigned char *) key, strlen(key));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
Reference in New Issue
Block a user