diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-02 23:09:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-02 23:09:25 +0900 |
commit | fae537259da3dd61fb62ae65d382a0ddc7c215dc (patch) | |
tree | 102ea1609bab37565c23628d7e8e65570fe3809b /class.c | |
parent | f5806eb2067f905d71bdce0553dcfeb8585d1371 (diff) | |
download | ruby-fae537259da3dd61fb62ae65d382a0ddc7c215dc.tar.gz |
Removed no longer used variable `last_hash`
1. By substituting `n_var` with its initializer, `0 < n_var` is
equivalent to `argc > argi + n_trail`.
2. As `argi` is non-negative, so `argi + n_trail >= n_trail`, and
the above expression is equivalent to `argc > n_trail`.
3. Therefore, `f_last` is always false, and `last_hash` is no
longer used.
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -1964,7 +1964,6 @@ struct rb_scan_args_t { int n_mand; int argi; VALUE hash; - VALUE last_hash; }; static void @@ -2065,11 +2064,7 @@ rb_scan_args_assign(struct rb_scan_args_t *arg, va_list vargs) var = va_arg(vargs, VALUE *); if (0 < n_var) { - if (var) { - int f_last = (arg->argc == arg->n_trail); - *var = rb_ary_new4(n_var - f_last, &arg->argv[argi]); - if (f_last) rb_ary_push(*var, arg->last_hash); - } + if (var) *var = rb_ary_new4(n_var, &arg->argv[argi]); argi += n_var; } else { |