mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
class.c: simplify
* class.c (rb_scan_args): merge code for n_trail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c7bc778dde
commit
29123a3799
2 changed files with 8 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed May 25 17:13:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* class.c (rb_scan_args): merge code for n_trail.
|
||||
|
||||
Wed May 25 17:11:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (rb_scan_args_validate): move failed
|
||||
|
|
14
class.c
14
class.c
|
@ -1901,22 +1901,16 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
|
|||
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++;
|
||||
|
|
Loading…
Add table
Reference in a new issue