diff --git a/ChangeLog b/ChangeLog index 44e31834b9..85de30cb87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -Sat May 31 08:58:22 2014 Nobuyoshi Nakada +Sat May 31 08:58:32 2014 Nobuyoshi Nakada + + * 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. diff --git a/enc/unicode.c b/enc/unicode.c index 2394319a9d..0c608fb906 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -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);