ruby-changes:26756
From: marcandre <ko1@a...>
Date: Mon, 14 Jan 2013 10:20:22 +0900 (JST)
Subject: [ruby-changes:26756] marcandRe: r38808 (trunk): * enumerator.c: Fix size for Enumerator::Lazy#flat_map
marcandre 2013-01-14 10:19:12 +0900 (Mon, 14 Jan 2013) New Revision: 38808 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38808 Log: * enumerator.c: Fix size for Enumerator::Lazy#flat_map Modified files: trunk/ChangeLog trunk/enumerator.c trunk/test/ruby/test_lazy_enumerator.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 38807) +++ ChangeLog (revision 38808) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jan 14 10:18:56 2013 Marc-Andre Lafortune <ruby-core@m...> + + * enumerator.c: Fix size for Enumerator::Lazy#flat_map + Mon Jan 14 07:12:52 2013 Marc-Andre Lafortune <ruby-core@m...> * lib/matrix/lup_decomposition: Fix bugs with LUP Decomposition of Index: enumerator.c =================================================================== --- enumerator.c (revision 38807) +++ enumerator.c (revision 38808) @@ -1486,7 +1486,7 @@ lazy_flat_map(VALUE obj) https://github.com/ruby/ruby/blob/trunk/enumerator.c#L1486 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 Index: test/ruby/test_lazy_enumerator.rb =================================================================== --- test/ruby/test_lazy_enumerator.rb (revision 38807) +++ test/ruby/test_lazy_enumerator.rb (revision 38808) @@ -329,11 +329,11 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lazy_enumerator.rb#L329 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/