🌐 AI搜索 & 代理 主页
Skip to content

Commit 54c41a6

Browse files
committed
1 parent 9c8de15 commit 54c41a6

File tree

5 files changed

+0
-49
lines changed

5 files changed

+0
-49
lines changed

src/backend/utils/adt/pg_locale.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,21 +1625,6 @@ pg_towlower(pg_wchar wc, pg_locale_t locale)
16251625
return locale->ctype->wc_tolower(wc, locale);
16261626
}
16271627

1628-
/*
1629-
* char_is_cased()
1630-
*
1631-
* Fuzzy test of whether the given char is case-varying or not. The argument
1632-
* is a single byte, so in a multibyte encoding, just assume any non-ASCII
1633-
* char is case-varying.
1634-
*/
1635-
bool
1636-
char_is_cased(char ch, pg_locale_t locale)
1637-
{
1638-
if (locale->ctype == NULL)
1639-
return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
1640-
return locale->ctype->char_is_cased(ch, locale);
1641-
}
1642-
16431628
/*
16441629
* Return required encoding ID for the given locale, or -1 if any encoding is
16451630
* valid for the locale.

src/backend/utils/adt/pg_locale_builtin.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,6 @@ wc_iscased_builtin(pg_wchar wc, pg_locale_t locale)
191191
return pg_u_prop_cased(to_char32(wc));
192192
}
193193

194-
static bool
195-
char_is_cased_builtin(char ch, pg_locale_t locale)
196-
{
197-
return IS_HIGHBIT_SET(ch) ||
198-
(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
199-
}
200-
201194
static pg_wchar
202195
wc_toupper_builtin(pg_wchar wc, pg_locale_t locale)
203196
{
@@ -225,7 +218,6 @@ static const struct ctype_methods ctype_methods_builtin = {
225218
.wc_ispunct = wc_ispunct_builtin,
226219
.wc_isspace = wc_isspace_builtin,
227220
.wc_isxdigit = wc_isxdigit_builtin,
228-
.char_is_cased = char_is_cased_builtin,
229221
.wc_iscased = wc_iscased_builtin,
230222
.wc_tolower = wc_tolower_builtin,
231223
.wc_toupper = wc_toupper_builtin,

src/backend/utils/adt/pg_locale_icu.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,6 @@ static int32_t u_strFoldCase_default(UChar *dest, int32_t destCapacity,
121121
const char *locale,
122122
UErrorCode *pErrorCode);
123123

124-
static bool
125-
char_is_cased_icu(char ch, pg_locale_t locale)
126-
{
127-
return IS_HIGHBIT_SET(ch) ||
128-
(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
129-
}
130-
131124
/*
132125
* XXX: many of the functions below rely on casts directly from pg_wchar to
133126
* UChar32, which is correct for the UTF-8 encoding, but not in general.
@@ -244,7 +237,6 @@ static const struct ctype_methods ctype_methods_icu = {
244237
.wc_ispunct = wc_ispunct_icu,
245238
.wc_isspace = wc_isspace_icu,
246239
.wc_isxdigit = wc_isxdigit_icu,
247-
.char_is_cased = char_is_cased_icu,
248240
.wc_iscased = wc_iscased_icu,
249241
.wc_toupper = toupper_icu,
250242
.wc_tolower = tolower_icu,

src/backend/utils/adt/pg_locale_libc.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -262,17 +262,6 @@ wc_iscased_libc_mb(pg_wchar wc, pg_locale_t locale)
262262
iswlower_l((wint_t) wc, locale->lt);
263263
}
264264

265-
static bool
266-
char_is_cased_libc(char ch, pg_locale_t locale)
267-
{
268-
bool is_multibyte = pg_database_encoding_max_length() > 1;
269-
270-
if (is_multibyte && IS_HIGHBIT_SET(ch))
271-
return true;
272-
else
273-
return isalpha_l((unsigned char) ch, locale->lt);
274-
}
275-
276265
static pg_wchar
277266
toupper_libc_sb(pg_wchar wc, pg_locale_t locale)
278267
{
@@ -345,7 +334,6 @@ static const struct ctype_methods ctype_methods_libc_sb = {
345334
.wc_ispunct = wc_ispunct_libc_sb,
346335
.wc_isspace = wc_isspace_libc_sb,
347336
.wc_isxdigit = wc_isxdigit_libc_sb,
348-
.char_is_cased = char_is_cased_libc,
349337
.wc_iscased = wc_iscased_libc_sb,
350338
.wc_toupper = toupper_libc_sb,
351339
.wc_tolower = tolower_libc_sb,
@@ -371,7 +359,6 @@ static const struct ctype_methods ctype_methods_libc_other_mb = {
371359
.wc_ispunct = wc_ispunct_libc_sb,
372360
.wc_isspace = wc_isspace_libc_sb,
373361
.wc_isxdigit = wc_isxdigit_libc_sb,
374-
.char_is_cased = char_is_cased_libc,
375362
.wc_iscased = wc_iscased_libc_sb,
376363
.wc_toupper = toupper_libc_sb,
377364
.wc_tolower = tolower_libc_sb,
@@ -393,7 +380,6 @@ static const struct ctype_methods ctype_methods_libc_utf8 = {
393380
.wc_ispunct = wc_ispunct_libc_mb,
394381
.wc_isspace = wc_isspace_libc_mb,
395382
.wc_isxdigit = wc_isxdigit_libc_mb,
396-
.char_is_cased = char_is_cased_libc,
397383
.wc_iscased = wc_iscased_libc_mb,
398384
.wc_toupper = toupper_libc_mb,
399385
.wc_tolower = tolower_libc_mb,

src/include/utils/pg_locale.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ struct ctype_methods
125125
bool (*wc_iscased) (pg_wchar wc, pg_locale_t locale);
126126
pg_wchar (*wc_toupper) (pg_wchar wc, pg_locale_t locale);
127127
pg_wchar (*wc_tolower) (pg_wchar wc, pg_locale_t locale);
128-
129-
/* required */
130-
bool (*char_is_cased) (char ch, pg_locale_t locale);
131128
};
132129

133130
/*
@@ -178,7 +175,6 @@ extern pg_locale_t pg_newlocale_from_collation(Oid collid);
178175

179176
extern char *get_collation_actual_version(char collprovider, const char *collcollate);
180177

181-
extern bool char_is_cased(char ch, pg_locale_t locale);
182178
extern size_t pg_strlower(char *dst, size_t dstsize,
183179
const char *src, ssize_t srclen,
184180
pg_locale_t locale);

0 commit comments

Comments
 (0)