[前][次][番号順一覧][スレッド一覧]

ruby-changes:34192

From: nobu <ko1@a...>
Date: Sat, 31 May 2014 08:58:47 +0900 (JST)
Subject: [ruby-changes:34192] nobu:r46273 (trunk): unicode.c: no initialization

nobu	2014-05-31 08:58:34 +0900 (Sat, 31 May 2014)

  New Revision: 46273

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=46273&view=revision

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

  Modified files:
    trunk/ChangeLog
    trunk/enc/unicode.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46272)
+++ ChangeLog	(revision 46273)
@@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Sat May 31 08:58:22 2014  Nobuyoshi Nakada  <nobu@r...>
+Sat May 31 08:58:32 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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.
Index: enc/unicode.c
===================================================================
--- enc/unicode.c	(revision 46272)
+++ enc/unicode.c	(revision 46273)
@@ -219,18 +219,6 @@ onigenc_unicode_property_name_to_ctype(O https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L219
   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(OnigEncodi https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L234
   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(Onig https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L285
   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_s https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L420
   const CodePointList3 *to, *z3;
   const CodePointList2 *z2;
 
-  if (CaseFoldInited == 0) init_case_fold_table();
-
   n = 0;
 
   code = ONIGENC_MBC_TO_CODE(enc, p, end);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]