diff options
| author | Jeff Davis | 2023-02-23 19:17:41 +0000 |
|---|---|---|
| committer | Jeff Davis | 2023-02-23 19:17:41 +0000 |
| commit | 6974a8f7682beeb515b78b34a5253d5f96552f58 (patch) | |
| tree | dd841520c02af8a0a18f96790c04a8f70bedde30 /src/backend/access | |
| parent | d87d548cd0304477413a73e9c1d148fb2d40b50d (diff) | |
Refactor to introduce pg_locale_deterministic().
Avoids the need of callers to test for NULL, and also avoids the need
to access the pg_locale_t structure directly.
Reviewed-by: Peter Eisentraut, Peter Geoghegan
Discussion: https://postgr.es/m/a581136455c940d7bd0ff482d3a2bd51af25a94f.camel%40j-davis.com
Diffstat (limited to 'src/backend/access')
| -rw-r--r-- | src/backend/access/hash/hashfunc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c index 2deba44abd..2e2fd5566e 100644 --- a/src/backend/access/hash/hashfunc.c +++ b/src/backend/access/hash/hashfunc.c @@ -282,7 +282,7 @@ hashtext(PG_FUNCTION_ARGS) if (!lc_collate_is_c(collid)) mylocale = pg_newlocale_from_collation(collid); - if (!mylocale || mylocale->deterministic) + if (pg_locale_deterministic(mylocale)) { result = hash_any((unsigned char *) VARDATA_ANY(key), VARSIZE_ANY_EXHDR(key)); @@ -342,7 +342,7 @@ hashtextextended(PG_FUNCTION_ARGS) if (!lc_collate_is_c(collid)) mylocale = pg_newlocale_from_collation(collid); - if (!mylocale || mylocale->deterministic) + if (pg_locale_deterministic(mylocale)) { result = hash_any_extended((unsigned char *) VARDATA_ANY(key), VARSIZE_ANY_EXHDR(key), |
