From 62e67609b694000cfdb5b80152d3c48a90cfb79b Mon Sep 17 00:00:00 2001 From: marcandre Date: Mon, 14 Jan 2013 01:19:12 +0000 Subject: [PATCH] * enumerator.c: Fix size for Enumerator::Lazy#flat_map git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ enumerator.c | 2 +- test/ruby/test_lazy_enumerator.rb | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3cf4d3c5e..d91122dc6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Jan 14 10:18:56 2013 Marc-Andre Lafortune + + * enumerator.c: Fix size for Enumerator::Lazy#flat_map + Mon Jan 14 07:12:52 2013 Marc-Andre Lafortune * lib/matrix/lup_decomposition: Fix bugs with LUP Decomposition of diff --git a/enumerator.c b/enumerator.c index a4ad915464..d488093ce8 100644 --- a/enumerator.c +++ b/enumerator.c @@ -1486,7 +1486,7 @@ lazy_flat_map(VALUE obj) return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj, lazy_flat_map_func, 0), - Qnil, lazy_receiver_size); + Qnil, 0); } static VALUE diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 232e0fed3a..7576c942a5 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -329,11 +329,11 @@ EOS lazy = [1, 2, 3].lazy assert_equal 3, lazy.size assert_equal 42, Enumerator.new(42){}.lazy.size - %i[map collect flat_map collect_concat].each do |m| + %i[map collect].each do |m| assert_equal 3, lazy.send(m){}.size end assert_equal 3, lazy.zip([4]).size - %i[select find_all reject take_while drop_while].each do |m| + %i[flat_map collect_concat select find_all reject take_while drop_while].each do |m| assert_equal nil, lazy.send(m){}.size end assert_equal nil, lazy.grep(//).size