aboutsummaryrefslogtreecommitdiffstats
path: root/enc/unicode.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-29 16:29:06 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-29 16:29:06 +0000
commit291fa223cfb2349c5e7fc5bb0e7729a2cfcc52cf (patch)
tree575b9cf8fa53adeedd5cc53b801da706c1598069 /enc/unicode.c
parent31eb29fe975bdf1d1e7ed5f3eb991430b381bc06 (diff)
downloadruby-291fa223cfb2349c5e7fc5bb0e7729a2cfcc52cf.tar.gz
* regparse.c (is_onechar_cclass): optimize character class
Merge Onigmo 27278c12e6674043cc8affca6507e20e119a86ee. * regparse.c (is_onechar_cclass): [bug] unexpected match occurs when a char class contains no char * enc/unicode.c (init_case_fold_table): define the sizes of case folding tables in casefold.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/unicode.c')
-rw-r--r--enc/unicode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/enc/unicode.c b/enc/unicode.c
index 1dda3f32f8..20990c1e54 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -238,7 +238,7 @@ static int init_case_fold_table(void)
THREAD_ATOMIC_START;
- FoldTable = st_init_numtable_with_size(1400);
+ FoldTable = st_init_numtable_with_size(FOLD_TABLE_SIZE);
if (ONIG_IS_NULL(FoldTable)) return ONIGERR_MEMORY;
for (i = 0; i < numberof(CaseFold); i++) {
p = &CaseFold[i];
@@ -249,7 +249,7 @@ static int init_case_fold_table(void)
st_add_direct(FoldTable, (st_data_t )p->from, (st_data_t )&(p->to));
}
- Unfold1Table = st_init_numtable_with_size(1200);
+ Unfold1Table = st_init_numtable_with_size(UNFOLD1_TABLE_SIZE);
if (ONIG_IS_NULL(Unfold1Table)) return ONIGERR_MEMORY;
for (i = 0; i < numberof(CaseUnfold_11); i++) {
@@ -261,7 +261,7 @@ static int init_case_fold_table(void)
st_add_direct(Unfold1Table, (st_data_t )p1->from, (st_data_t )&(p1->to));
}
- Unfold2Table = st_init_table_with_size(&type_code2_hash, 200);
+ Unfold2Table = st_init_table_with_size(&type_code2_hash, UNFOLD2_TABLE_SIZE);
if (ONIG_IS_NULL(Unfold2Table)) return ONIGERR_MEMORY;
for (i = 0; i < numberof(CaseUnfold_12); i++) {
@@ -273,7 +273,7 @@ static int init_case_fold_table(void)
st_add_direct(Unfold2Table, (st_data_t )p2->from, (st_data_t )(&p2->to));
}
- Unfold3Table = st_init_table_with_size(&type_code3_hash, 30);
+ Unfold3Table = st_init_table_with_size(&type_code3_hash, UNFOLD3_TABLE_SIZE);
if (ONIG_IS_NULL(Unfold3Table)) return ONIGERR_MEMORY;
for (i = 0; i < numberof(CaseUnfold_13); i++) {