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

ruby-changes:22986

From: nobu <ko1@a...>
Date: Thu, 15 Mar 2012 15:05:08 +0900 (JST)
Subject: [ruby-changes:22986] nobu:r35035 (trunk): * util.c (ruby_strtod): no need to check same digit for hexdigit

nobu	2012-03-15 15:04:56 +0900 (Thu, 15 Mar 2012)

  New Revision: 35035

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

  Log:
    * util.c (ruby_strtod): no need to check same digit for hexdigit
      twice.  [ruby-dev:45363][Bug #6146]

  Modified files:
    trunk/ChangeLog
    trunk/util.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35034)
+++ ChangeLog	(revision 35035)
@@ -1,5 +1,8 @@
-Thu Mar 15 15:04:41 2012  Nobuyoshi Nakada  <nobu@r...>
+Thu Mar 15 15:04:54 2012  Nobuyoshi Nakada  <nobu@r...>
 
+	* util.c (ruby_strtod): no need to check same digit for hexdigit
+	  twice.  [ruby-dev:45363][Bug #6146]
+
 	* parse.y (sym_check_asciionly): check ascii compatibility before
 	  scanning for code range.
 
Index: util.c
===================================================================
--- util.c	(revision 35034)
+++ util.c	(revision 35035)
@@ -1977,8 +1977,11 @@
 	    nd0 = -4;
 
 	    if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0;
-	    while (*s == '0') s++;
-	    if ((s1 = strchr(hexdigit, *s)) != NULL) {
+	    if (*s == '0') {
+		while (*++s == '0');
+		s1 = strchr(hexdigit, *s);
+	    }
+	    if (s1 != NULL) {
 		do {
 		    adj += aadj * ((s1 - hexdigit) & 15);
 		    nd0 += 4;

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

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