diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-10 09:25:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-10 09:25:58 +0000 |
commit | 5ce428bd18599e8135632aded64c51a8b60a9a3f (patch) | |
tree | 0c7e5194b5a2a9482ac7d523eac609baf0249802 /hash.c | |
parent | b5cdd260c519a0f29e58acbc21e77bf3f0de74fb (diff) | |
download | ruby-5ce428bd18599e8135632aded64c51a8b60a9a3f.tar.gz |
hash.c: use rb_func_proc_new
* hash.c (rb_hash_to_proc): use rb_func_proc_new to make light
weight proc. [Feature #11653]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2769,13 +2769,14 @@ rb_hash_gt(VALUE hash, VALUE other) static VALUE hash_proc_call(VALUE key, VALUE hash, int argc, const VALUE *argv, VALUE passed_proc) { - return rb_hash_aref(hash, key); + rb_check_arity(argc, 1, 1); + return rb_hash_aref(hash, *argv); } static VALUE rb_hash_to_proc(VALUE hash) { - return rb_proc_new(hash_proc_call, hash); + return rb_func_proc_new(hash_proc_call, hash); } static int path_tainted = -1; |