diff --git a/ChangeLog b/ChangeLog index 7f0d3c6814..2c027ef85d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Jul 15 14:13:02 2013 Masaki Matsushita + + * struct.c (rb_struct_each_pair): use rb_yield_values(2, key, value) + instead of rb_yield(rb_assoc_new(key, value)) if rb_block_arity() + is greater than 1. + Mon Jul 15 13:46:26 2013 Tanaka Akira * bignum.c: Add static assertions. diff --git a/struct.c b/struct.c index 5dc5e73ae8..90af2d0568 100644 --- a/struct.c +++ b/struct.c @@ -524,10 +524,19 @@ rb_struct_each_pair(VALUE s) RETURN_SIZED_ENUMERATOR(s, 0, 0, struct_enum_size); members = rb_struct_members(s); - for (i=0; i 1) { + for (i=0; i