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

ruby-changes:33567

From: naruse <ko1@a...>
Date: Mon, 21 Apr 2014 19:14:48 +0900 (JST)
Subject: [ruby-changes:33567] naruse:r45648 (trunk): * string.c (coderange_scan): remove unused logic.

naruse	2014-04-21 19:14:43 +0900 (Mon, 21 Apr 2014)

  New Revision: 45648

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

  Log:
    * string.c (coderange_scan): remove unused logic.
    
    * string.c (rb_str_coderange_scan_restartable): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/string.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45647)
+++ ChangeLog	(revision 45648)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Apr 21 18:19:35 2014  NARUSE, Yui  <naruse@r...>
+
+	* string.c (coderange_scan): remove unused logic.
+
+	* string.c (rb_str_coderange_scan_restartable): ditto.
+
 Mon Apr 21 14:11:48 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/stringio/stringio.c (strio_putc): fix for non-ascii
Index: string.c
===================================================================
--- string.c	(revision 45647)
+++ string.c	(revision 45648)
@@ -328,9 +328,6 @@ coderange_scan(const char *p, long len, https://github.com/ruby/ruby/blob/trunk/string.c#L328
                 }
             }
         }
-        if (e < p) {
-            return ENC_CODERANGE_BROKEN;
-        }
         return ENC_CODERANGE_VALID;
     }
 
@@ -342,9 +339,6 @@ coderange_scan(const char *p, long len, https://github.com/ruby/ruby/blob/trunk/string.c#L339
         }
         p += MBCLEN_CHARFOUND_LEN(ret);
     }
-    if (e < p) {
-        return ENC_CODERANGE_BROKEN;
-    }
     return ENC_CODERANGE_VALID;
 }
 
@@ -383,7 +377,7 @@ rb_str_coderange_scan_restartable(const https://github.com/ruby/ruby/blob/trunk/string.c#L377
 		}
 	    }
 	}
-	*cr = e < p ? ENC_CODERANGE_BROKEN: ENC_CODERANGE_VALID;
+	*cr = ENC_CODERANGE_VALID;
 	return p - s;
     }
     else {
@@ -395,7 +389,7 @@ rb_str_coderange_scan_restartable(const https://github.com/ruby/ruby/blob/trunk/string.c#L389
 	    }
 	    p += MBCLEN_CHARFOUND_LEN(ret);
 	}
-	*cr = e < p ? ENC_CODERANGE_BROKEN: ENC_CODERANGE_VALID;
+	*cr = ENC_CODERANGE_VALID;
 	return p - s;
     }
 }

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

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