aboutsummaryrefslogtreecommitdiffstats
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-19 00:45:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-19 00:45:22 +0000
commit2d5cd15d830aa56796ad06671daa3a21dfb6143c (patch)
treea886276003bf96709c2e5fdaddcb04b456278f8e /class.c
parentb82a4f6e047ab08a5cfeea1c8417041ec409cdd0 (diff)
downloadruby-2d5cd15d830aa56796ad06671daa3a21dfb6143c.tar.gz
class.c: call rb_hash_keys directly
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/class.c b/class.c
index f0b6ba0c07..263cb759ca 100644
--- a/class.c
+++ b/class.c
@@ -1804,15 +1804,12 @@ static void
unknown_keyword_error(VALUE hash, const ID *table, int keywords)
{
st_table *tbl = rb_hash_tbl_raw(hash);
- VALUE keys;
int i;
for (i = 0; i < keywords; i++) {
st_data_t key = ID2SYM(table[i]);
st_delete(tbl, &key, NULL);
}
- keys = rb_funcallv(hash, rb_intern("keys"), 0, 0);
- if (!RB_TYPE_P(keys, T_ARRAY)) rb_raise(rb_eArgError, "unknown keyword");
- rb_keyword_error("unknown", keys);
+ rb_keyword_error("unknown", rb_hash_keys(hash));
}
static int