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

ruby-changes:42043

From: duerst <ko1@a...>
Date: Tue, 15 Mar 2016 16:17:14 +0900 (JST)
Subject: [ruby-changes:42043] duerst:r54117 (trunk): * enc/unicode.c: Expansion of some code repetition in preparation for

duerst	2016-03-15 16:17:09 +0900 (Tue, 15 Mar 2016)

  New Revision: 54117

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

  Log:
    * enc/unicode.c: Expansion of some code repetition in preparation for
      elimination of common code pieces.
      (with Kimihito Matsui)

  Modified files:
    trunk/ChangeLog
    trunk/enc/unicode.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54116)
+++ ChangeLog	(revision 54117)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Mar 15 16:17:09 2016  Martin Duerst  <duerst@i...>
+
+	* enc/unicode.c: Expansion of some code repetition in preparation for
+	  elimination of common code pieces.
+	  (with Kimihito Matsui)
+
 Tue Mar 15 13:49:23 2016  Martin Duerst  <duerst@i...>
 
 	* enc/unicode.c: Additional macros and code to use mapping data in
Index: enc/unicode.c
===================================================================
--- enc/unicode.c	(revision 54116)
+++ enc/unicode.c	(revision 54117)
@@ -725,9 +725,7 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L725
 				SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
 			}
 			if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_DOWN_SPECIAL) {
-			    if (flags&ONIGENC_CASE_DOWN_SPECIAL)
-				goto SpecialsCopy;
-			    else
+			    if (!(flags&ONIGENC_CASE_DOWN_SPECIAL))
 				SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
 			}
 			/* if we pass here, we know we use special upcasing, and are at the right position */
@@ -737,12 +735,15 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L735
 			if (count==1)
 			    code = SpecialsCodepointExtract(*next);
 			else if (count==2) {
-			    to += ONIGENC_CODE_TO_MBC(enc, SpecialsCodepointExtract(*next++), to);
+			    code = SpecialsCodepointExtract(*next++);
+			    to += ONIGENC_CODE_TO_MBC(enc, code, to);
 			    code = *next;
 			}
 			else { /* count == 3 */
-			    to += ONIGENC_CODE_TO_MBC(enc, SpecialsCodepointExtract(*next++), to);
-			    to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
+			    code = SpecialsCodepointExtract(*next++);
+			    to += ONIGENC_CODE_TO_MBC(enc, code, to);
+			    code = *next++;
+			    to += ONIGENC_CODE_TO_MBC(enc, code, to);
 			    code = *next;
 			}
 		    }
@@ -752,12 +753,15 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L753
 			if (count==1)
 			    code = *next;
 			else if (count==2) {
-			    to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
+			    code = *next++;
+			    to += ONIGENC_CODE_TO_MBC(enc, code, to);
 			    code = *next;
 			}
 			else { /* count == 3 */
-			    to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
-			    to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
+			    code = *next++;
+			    to += ONIGENC_CODE_TO_MBC(enc, code, to);
+			    code = *next++;
+			    to += ONIGENC_CODE_TO_MBC(enc, code, to);
 			    code = *next;
 			}
 		    }

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

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