summaryrefslogtreecommitdiff
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2020-02-02 23:09:25 +0900
committerGitHub <[email protected]>2020-02-02 23:09:25 +0900
commitfae537259da3dd61fb62ae65d382a0ddc7c215dc (patch)
tree102ea1609bab37565c23628d7e8e65570fe3809b /include/ruby/ruby.h
parentf5806eb2067f905d71bdce0553dcfeb8585d1371 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2873 Merged-By: nobu <[email protected]>
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r--include/ruby/ruby.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index dc1eb29e0c..3402d73515 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -2482,7 +2482,7 @@ rb_scan_args_set(int argc, const VALUE *argv,
# endif
{
int i, argi = 0, vari = 0;
- VALUE *var, hash = Qnil, last_hash = 0;
+ VALUE *var, hash = Qnil;
const int n_mand = n_lead + n_trail;
if (f_hash && argc > 0 && rb_keyword_given_p()) {
@@ -2517,11 +2517,7 @@ rb_scan_args_set(int argc, const VALUE *argv,
var = vars[vari++];
if (0 < n_var) {
- if (var) {
- int f_last = (argc == n_trail);
- *var = rb_ary_new4(n_var-f_last, &argv[argi]);
- if (f_last) rb_ary_push(*var, last_hash);
- }
+ if (var) *var = rb_ary_new4(n_var, &argv[argi]);
argi += n_var;
}
else {