Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit792b2c7

Browse files
committed
Remove pg_regex_collation
We can also use the existing pg_regex_locale as the cache key, whichis the only use of this variable.Reviewed-by: Jeff Davis <pgsql@j-davis.com>Discussion:https://www.postgresql.org/message-id/flat/b1b92ae1-2e06-4619-a87a-4b4858e547ec%40eisentraut.org
1 parent71cb352 commit792b2c7

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

‎src/backend/regex/regc_pg_locale.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ typedef enum
7474

7575
staticPG_Locale_Strategypg_regex_strategy;
7676
staticpg_locale_tpg_regex_locale;
77-
staticOidpg_regex_collation;
7877

7978
/*
8079
* Hard-wired character properties for C locale
@@ -254,7 +253,7 @@ pg_set_regex_collation(Oid collation)
254253
* pg_newlocale_from_collation().
255254
*/
256255
strategy=PG_REGEX_STRATEGY_C;
257-
collation=C_COLLATION_OID;
256+
locale=0;
258257
}
259258
else
260259
{
@@ -273,7 +272,6 @@ pg_set_regex_collation(Oid collation)
273272
*/
274273
strategy=PG_REGEX_STRATEGY_C;
275274
locale=0;
276-
collation=C_COLLATION_OID;
277275
}
278276
elseif (locale->provider==COLLPROVIDER_BUILTIN)
279277
{
@@ -298,7 +296,6 @@ pg_set_regex_collation(Oid collation)
298296

299297
pg_regex_strategy=strategy;
300298
pg_regex_locale=locale;
301-
pg_regex_collation=collation;
302299
}
303300

304301
staticint
@@ -628,7 +625,7 @@ typedef int (*pg_wc_probefunc) (pg_wchar c);
628625
typedefstructpg_ctype_cache
629626
{
630627
pg_wc_probefuncprobefunc;/* pg_wc_isalpha or a sibling */
631-
Oidcollation;/*collation this entry is for */
628+
pg_locale_tlocale;/*locale this entry is for */
632629
structcveccv;/* cache entry contents */
633630
structpg_ctype_cache*next;/* chain link */
634631
}pg_ctype_cache;
@@ -697,7 +694,7 @@ pg_ctype_get_cache(pg_wc_probefunc probefunc, int cclasscode)
697694
for (pcc=pg_ctype_cache_list;pcc!=NULL;pcc=pcc->next)
698695
{
699696
if (pcc->probefunc==probefunc&&
700-
pcc->collation==pg_regex_collation)
697+
pcc->locale==pg_regex_locale)
701698
return&pcc->cv;
702699
}
703700

@@ -708,7 +705,7 @@ pg_ctype_get_cache(pg_wc_probefunc probefunc, int cclasscode)
708705
if (pcc==NULL)
709706
returnNULL;
710707
pcc->probefunc=probefunc;
711-
pcc->collation=pg_regex_collation;
708+
pcc->locale=pg_regex_locale;
712709
pcc->cv.nchrs=0;
713710
pcc->cv.chrspace=128;
714711
pcc->cv.chrs= (chr*)malloc(pcc->cv.chrspace*sizeof(chr));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp