1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

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
This commit is contained in:
Jeff Davis
2024-09-04 12:30:14 -07:00
parent 83eb481d52
commit 06421b0843
8 changed files with 35 additions and 73 deletions

View File

@@ -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