1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

unicode.c: no initialization

* enc/unicode.c (init_case_fold_table): no longer need to
  initialize tables at runtime.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-05-30 23:58:34 +00:00
parent 7e67b39679
commit dd20f90408
2 changed files with 4 additions and 19 deletions

View file

@ -1,4 +1,7 @@
Sat May 31 08:58:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
Sat May 31 08:58:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enc/unicode.c (init_case_fold_table): no longer need to
initialize tables at runtime.
* enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
lookup case unfolding table 3.

View file

@ -219,18 +219,6 @@ onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end
return ctype;
}
static int CaseFoldInited = 0;
static int init_case_fold_table(void)
{
THREAD_ATOMIC_START;
CaseFoldInited = 1;
THREAD_ATOMIC_END;
return 0;
}
#define onigenc_unicode_fold_lookup onigenc_unicode_CaseFold_11_lookup
#define onigenc_unicode_unfold1_lookup onigenc_unicode_CaseUnfold_11_lookup
#define onigenc_unicode_unfold2_lookup onigenc_unicode_CaseUnfold_12_lookup
@ -246,8 +234,6 @@ onigenc_unicode_mbc_case_fold(OnigEncoding enc,
int i, len, rlen;
const UChar *p = *pp;
if (CaseFoldInited == 0) init_case_fold_table();
code = ONIGENC_MBC_TO_CODE(enc, p, end);
len = enclen(enc, p, end);
*pp += len;
@ -299,8 +285,6 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
OnigCodePoint code;
int i, j, k, r;
/* if (CaseFoldInited == 0) init_case_fold_table(); */
for (i = 0; i < numberof(CaseUnfold_11); i++) {
p11 = &CaseUnfold_11[i];
for (j = 0; j < p11->to.n; j++) {
@ -436,8 +420,6 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
const CodePointList3 *to, *z3;
const CodePointList2 *z2;
if (CaseFoldInited == 0) init_case_fold_table();
n = 0;
code = ONIGENC_MBC_TO_CODE(enc, p, end);