1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove unused tmp_buffer in class.c

ref 44a164c26f and beae6cbf0f
This commit is contained in:
Kazuhiro NISHIYAMA 2020-01-05 12:25:24 +09:00
parent 787c6d591a
commit c7af1e432a
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A

11
class.c
View file

@ -1960,7 +1960,6 @@ struct rb_scan_args_t {
int argi;
VALUE hash;
VALUE last_hash;
VALUE *tmp_buffer;
};
static void
@ -2105,16 +2104,11 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
{
int error;
va_list vargs;
VALUE tmp_buffer = 0;
struct rb_scan_args_t arg;
arg.tmp_buffer = &tmp_buffer;
rb_scan_args_parse(RB_SCAN_ARGS_PASS_CALLED_KEYWORDS, argc, argv, fmt, &arg);
va_start(vargs,fmt);
error = rb_scan_args_assign(&arg, vargs);
va_end(vargs);
if (tmp_buffer) {
rb_free_tmp_buffer(&tmp_buffer);
}
if (error) {
rb_error_arity(arg.argc, arg.n_mand, arg.f_var ? UNLIMITED_ARGUMENTS : arg.n_mand + arg.n_opt);
}
@ -2126,16 +2120,11 @@ rb_scan_args_kw(int kw_flag, int argc, const VALUE *argv, const char *fmt, ...)
{
int error;
va_list vargs;
VALUE tmp_buffer = 0;
struct rb_scan_args_t arg;
arg.tmp_buffer = &tmp_buffer;
rb_scan_args_parse(kw_flag, argc, argv, fmt, &arg);
va_start(vargs,fmt);
error = rb_scan_args_assign(&arg, vargs);
va_end(vargs);
if (tmp_buffer) {
rb_free_tmp_buffer(&tmp_buffer);
}
if (error) {
rb_error_arity(arg.argc, arg.n_mand, arg.f_var ? UNLIMITED_ARGUMENTS : arg.n_mand + arg.n_opt);
}