1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

Simplify checks for deterministic collations.

Remove redundant checks for locale->collate_is_c now that we always
have a valid pg_locale_t.

Also, remove pg_locale_deterministic() wrapper, which is no longer
useful after commit e9931bfb75. Just check the field directly,
consistent with other fields in pg_locale_t.

Author: Andreas Karlsson
Discussion: https://postgr.es/m/60929555-4709-40a7-b136-bcb44cff5a3c@proxel.se
This commit is contained in:
Jeff Davis
2024-09-12 13:35:56 -07:00
parent 6a9fc11033
commit b0c30612c5
7 changed files with 16 additions and 28 deletions

View File

@@ -279,7 +279,7 @@ hashtext(PG_FUNCTION_ARGS)
mylocale = pg_newlocale_from_collation(collid);
if (pg_locale_deterministic(mylocale))
if (mylocale->deterministic)
{
result = hash_any((unsigned char *) VARDATA_ANY(key),
VARSIZE_ANY_EXHDR(key));
@@ -334,7 +334,7 @@ hashtextextended(PG_FUNCTION_ARGS)
mylocale = pg_newlocale_from_collation(collid);
if (pg_locale_deterministic(mylocale))
if (mylocale->deterministic)
{
result = hash_any_extended((unsigned char *) VARDATA_ANY(key),
VARSIZE_ANY_EXHDR(key),