From 9c6ea2f2004081591417ab2195ca487053c3b101 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 8 Oct 2013 07:11:15 +0000 Subject: array.c: use rb_hash_values * array.c (rb_ary_uniq): use rb_hash_values(), as well as the case no block is given. * internal.h: define rb_hash_values() as internal API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index 3998f60afc..7e8617b771 100644 --- a/array.c +++ b/array.c @@ -4124,8 +4124,7 @@ rb_ary_uniq(VALUE ary) return rb_ary_dup(ary); if (rb_block_given_p()) { hash = ary_make_hash_by(ary); - uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash)); - st_foreach(rb_hash_tbl_raw(hash), push_value, uniq); + uniq = rb_hash_values(hash); } else { hash = ary_make_hash(ary); -- cgit v1.2.3