ruby-changes:47504
From: nobu <ko1@a...>
Date: Sat, 19 Aug 2017 09:45:27 +0900 (JST)
Subject: [ruby-changes:47504] nobu:r59620 (trunk): class.c: call rb_hash_keys directly
nobu 2017-08-19 09:45:22 +0900 (Sat, 19 Aug 2017) New Revision: 59620 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59620 Log: class.c: call rb_hash_keys directly Modified files: trunk/class.c Index: class.c =================================================================== --- class.c (revision 59619) +++ class.c (revision 59620) @@ -1804,15 +1804,12 @@ static void https://github.com/ruby/ruby/blob/trunk/class.c#L1804 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/