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

ruby-changes:43085

From: nobu <ko1@a...>
Date: Wed, 25 May 2016 17:13:40 +0900 (JST)
Subject: [ruby-changes:43085] nobu:r55159 (trunk): class.c: simplify

nobu	2016-05-25 17:13:37 +0900 (Wed, 25 May 2016)

  New Revision: 55159

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

  Log:
    class.c: simplify
    
    * class.c (rb_scan_args): merge code for n_trail.

  Modified files:
    trunk/ChangeLog
    trunk/class.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55158)
+++ ChangeLog	(revision 55159)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May 25 17:13:35 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* class.c (rb_scan_args): merge code for n_trail.
+
 Wed May 25 17:11:34 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/ruby.h (rb_scan_args_validate): move failed
Index: class.c
===================================================================
--- class.c	(revision 55158)
+++ class.c	(revision 55159)
@@ -1901,22 +1901,16 @@ rb_scan_args(int argc, const VALUE *argv https://github.com/ruby/ruby/blob/trunk/class.c#L1901
 	if (ISDIGIT(*p)) {
 	    n_opt = *p - '0';
 	    p++;
-	    if (ISDIGIT(*p)) {
-		n_trail = *p - '0';
-		p++;
-		goto block_arg;
-	    }
 	}
     }
     if (*p == '*') {
 	f_var = 1;
 	p++;
-	if (ISDIGIT(*p)) {
-	    n_trail = *p - '0';
-	    p++;
-	}
     }
-  block_arg:
+    if (ISDIGIT(*p)) {
+	n_trail = *p - '0';
+	p++;
+    }
     if (*p == ':') {
 	f_hash = 1;
 	p++;

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

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