diff options
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3908,7 +3908,9 @@ ary_add_hash(VALUE hash, VALUE ary) for (i=0; i<RARRAY_LEN(ary); i++) { VALUE elt = RARRAY_AREF(ary, i); - rb_hash_aset(hash, elt, elt); + if (rb_hash_lookup2(hash, elt, Qundef) == Qundef) { + rb_hash_aset(hash, elt, elt); + } } return hash; } |