summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-03 13:07:34 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-03 13:07:34 +0900
commit0ab7f2f2220cb40aa4c25f858b60eb9b4e9cb477 (patch)
treeae2f606d97719d706367c0bb93145c68a3325a2c /class.c
parent48c851f86846b273fba0692d5eae1eadf8bf9445 (diff)
Make `rb_scan_args_kw` inline too
Diffstat (limited to 'class.c')
-rw-r--r--class.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/class.c b/class.c
index a29d1df..c2abce1 100644
--- a/class.c
+++ b/class.c
@@ -2009,19 +2009,7 @@ rb_scan_args_assign(const struct rb_scan_args_t *arg, int argc, const VALUE *con
if (arg->f_hash && argc > 0) {
VALUE last = argv[argc - 1];
- int keyword_given = 0;
- switch (arg->kw_flag) {
- case RB_SCAN_ARGS_PASS_CALLED_KEYWORDS:
- keyword_given = rb_keyword_given_p();
- break;
- case RB_SCAN_ARGS_KEYWORDS:
- keyword_given = 1;
- break;
- case RB_SCAN_ARGS_LAST_HASH_KEYWORDS:
- keyword_given = RB_TYPE_P(last, T_HASH);
- break;
- }
- if (keyword_given) {
+ if (rb_scan_args_keyword_p(arg->kw_flag, last)) {
hash = rb_hash_dup(last);
argc--;
}
@@ -2107,6 +2095,7 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
return argc;
}
+#undef rb_scan_args_kw
int
rb_scan_args_kw(int kw_flag, int argc, const VALUE *argv, const char *fmt, ...)
{