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

ruby-changes:43587

From: duerst <ko1@a...>
Date: Wed, 13 Jul 2016 15:19:12 +0900 (JST)
Subject: [ruby-changes:43587] duerst:r55660 (trunk): * enc/iso_8859_1.c, enc/iso_8859_4.c: Avoid setting modification flag if

duerst	2016-07-13 15:19:07 +0900 (Wed, 13 Jul 2016)

  New Revision: 55660

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

  Log:
    * enc/iso_8859_1.c, enc/iso_8859_4.c: Avoid setting modification flag if
      there is no modification.

  Modified files:
    trunk/ChangeLog
    trunk/enc/iso_8859_1.c
    trunk/enc/iso_8859_4.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55659)
+++ ChangeLog	(revision 55660)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul 13 15:19:03 2016  Martin Duerst  <duerst@i...>
+
+	* enc/iso_8859_1.c, enc/iso_8859_4.c: Avoid setting modification flag if
+	  there is no modification.
+
 Wed Jul 13 14:40:04 2016  Martin Duerst  <duerst@i...>
 
 	* enc/iso_8859_5.c, test/ruby/enc/test_case_comprehensive.rb:
Index: enc/iso_8859_1.c
===================================================================
--- enc/iso_8859_1.c	(revision 55659)
+++ enc/iso_8859_1.c	(revision 55660)
@@ -284,13 +284,11 @@ case_map (OnigCaseFoldType* flagP, const https://github.com/ruby/ruby/blob/trunk/enc/iso_8859_1.c#L284
       flags |= ONIGENC_CASE_MODIFIED;
       code += 0x20;
     }
+    else if (code==0xAA || code==0xBA || code==0xB5 || code==0xFF)  ;
     else if ((EncISO_8859_1_CtypeTable[code]&BIT_CTYPE_LOWER)
 	     && (flags&ONIGENC_CASE_UPCASE)) {
       flags |= ONIGENC_CASE_MODIFIED;
-      if (code==0xAA || code==0xBA || code==0xB5 || code==0xFF)
-        ;
-      else
-        code -= 0x20;
+      code -= 0x20;
     }
     *to++ = code;
     if (flags&ONIGENC_CASE_TITLECASE)  /* switch from titlecase to lowercase for capitalize */
Index: enc/iso_8859_4.c
===================================================================
--- enc/iso_8859_4.c	(revision 55659)
+++ enc/iso_8859_4.c	(revision 55660)
@@ -252,14 +252,13 @@ case_map(OnigCaseFoldType* flagP, const https://github.com/ruby/ruby/blob/trunk/enc/iso_8859_4.c#L252
       flags |= ONIGENC_CASE_MODIFIED;
       code = ENC_ISO_8859_4_TO_LOWER_CASE(code);
     }
+    else if (code==0xA2)  ;
     else if ((EncISO_8859_4_CtypeTable[code]&BIT_CTYPE_LOWER)
 	     && (flags&ONIGENC_CASE_UPCASE)) {
       flags |= ONIGENC_CASE_MODIFIED;
       if (code>=0xA0&&code<=0xBF) {
 	if (code==0xBF)
 	  code -= 0x02;
-	else if (code==0xA2)
-	  ;
 	else
 	  code -= 0x10;
       }

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

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