summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-10 14:02:52 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-10 14:02:52 +0000
commit2423e3f350daafac5a10f7f74dd34ee61253ef54 (patch)
treef9d98e0fbe8a70db32dc7ed410484aba5a30ba2d /array.c
parent840cd22d8587c45056737317ed186d7433c94716 (diff)
* array.c (rb_ary_or): use rb_hash_keys().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/array.c b/array.c
index c45c992..fc2672b 100644
--- a/array.c
+++ b/array.c
@@ -4004,21 +4004,8 @@ rb_ary_or(VALUE ary1, VALUE ary2)
long i;
ary2 = to_ary(ary2);
- ary3 = rb_ary_new2(RARRAY_LEN(ary1)+RARRAY_LEN(ary2));
hash = ary_add_hash(ary_make_hash(ary1), ary2);
-
- for (i=0; i<RARRAY_LEN(ary1); i++) {
- vv = (st_data_t)(v = rb_ary_elt(ary1, i));
- if (st_delete(rb_hash_tbl_raw(hash), &vv, 0)) {
- rb_ary_push(ary3, v);
- }
- }
- for (i=0; i<RARRAY_LEN(ary2); i++) {
- vv = (st_data_t)(v = rb_ary_elt(ary2, i));
- if (st_delete(rb_hash_tbl_raw(hash), &vv, 0)) {
- rb_ary_push(ary3, v);
- }
- }
+ ary3 = rb_hash_keys(hash);
ary_recycle_hash(hash);
return ary3;
}