mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
class.c: call rb_hash_keys directly
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e3c42f53fb
commit
52d35e75cf
1 changed files with 1 additions and 4 deletions
5
class.c
5
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
|
||||
|
|
Loading…
Reference in a new issue