aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
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 c45c992840..fc2672bda8 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;
}