diff options
author | Jeff Davis <jdavis@postgresql.org> | 2024-09-04 12:30:14 -0700 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2024-09-04 14:35:25 -0700 |
commit | 06421b08436414b42cd169501005f15adee986f1 (patch) | |
tree | 2cf8e527daaf21dd9057f0d2a3a648e35367ff96 /src/backend/utils/adt/varchar.c | |
parent | 83eb481d527b541e2ef2a1b14ab2c56b2ccf362b (diff) | |
download | postgresql-06421b08436414b42cd169501005f15adee986f1.tar.gz postgresql-06421b08436414b42cd169501005f15adee986f1.zip |
Remove lc_collate_is_c().
Instead just look up the collation and check collate_is_c field.
Author: Andreas Karlsson
Discussion: https://postgr.es/m/60929555-4709-40a7-b136-bcb44cff5a3c@proxel.se
Diffstat (limited to 'src/backend/utils/adt/varchar.c')
-rw-r--r-- | src/backend/utils/adt/varchar.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 0c219dcc779..d2d1c5709d3 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -748,20 +748,16 @@ bpchareq(PG_FUNCTION_ARGS) len2; bool result; Oid collid = PG_GET_COLLATION(); - bool locale_is_c = false; - pg_locale_t mylocale = 0; + pg_locale_t mylocale; check_collation_set(collid); len1 = bcTruelen(arg1); len2 = bcTruelen(arg2); - if (lc_collate_is_c(collid)) - locale_is_c = true; - else - mylocale = pg_newlocale_from_collation(collid); + mylocale = pg_newlocale_from_collation(collid); - if (locale_is_c || pg_locale_deterministic(mylocale)) + if (mylocale->collate_is_c || pg_locale_deterministic(mylocale)) { /* * Since we only care about equality or not-equality, we can avoid all @@ -793,20 +789,16 @@ bpcharne(PG_FUNCTION_ARGS) len2; bool result; Oid collid = PG_GET_COLLATION(); - bool locale_is_c = false; - pg_locale_t mylocale = 0; + pg_locale_t mylocale; check_collation_set(collid); len1 = bcTruelen(arg1); len2 = bcTruelen(arg2); - if (lc_collate_is_c(collid)) - locale_is_c = true; - else - mylocale = pg_newlocale_from_collation(collid); + mylocale = pg_newlocale_from_collation(collid); - if (locale_is_c || pg_locale_deterministic(mylocale)) + if (mylocale->collate_is_c || pg_locale_deterministic(mylocale)) { /* * Since we only care about equality or not-equality, we can avoid all |