summaryrefslogtreecommitdiff
path: root/enumerator.c
AgeCommit message (Collapse)Author
2014-07-07merge revision(s) 46099: [Backport #9814]usa
* enumerator.c: [DOC] Fix example to show Enumerator#peek behavior Patch by Erik Hollembeak [Bug #9814] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12merge revision(s) 39722: [Backport #9178]nagachika
* enumerator.c (enumerator_with_index): try to convert given offset to integer. fix bug introduced in r39594. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-02merge revision(s) 43929: [Backport #9178]nagachika
* enumerator.c (enumerator_with_index): should not store local variable address to memoise the arguments. it is invalidated after the return. [ruby-core:58692] [Bug #9178] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@43961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-02merge revision(s) 39594,39596: [Backport #8010]nagachika
* enumerator.c (enumerator_with_index_i): allow Bignum as offset, to get rid of conversion exception and integer overflow. [ruby-dev:47131] [Bug #8010] * enumerator.c (enumerator_with_index): Restore handling of a nil memo from r39594. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@43960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-13merge revision(s) 42379: [Backport #8904]nagachika
* enumerator.c: [DOC] Remove reference to Enumerator::Lazy#cycle Patch by @kachick [Fixes GH-372] https://github.com/ruby/ruby/pull/372 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-12merge revision(s) 42450: [Backport #8735]nagachika
* enumerator.c (lazy_zip_func): fix non-single argument. fix out-of-bound access and pack multiple yielded values. [ruby-core:56383] [Bug #8735] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-04merge revision(s) 39329: [Backport #8011]nagachika
enumerator.c: suppress warnings * enumerator.c (lazy_zip_arrays_func, lazy_zip_func, lazy_take_func), (lazy_drop_func, lazy_drop_while_func): suppress uninitialized instance vriable warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-23* Backport r39438 from trunk:marcandre
* enumerator.c: rdoc fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05* enumerator.c: Remove rdoc that is obsolete because of lazymarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05* enumerator.c: Use to_enum for Enumerable methods returning Enumerators.marcandre
This makes Lazy#cycle no longer needed, so it was removed. Make Enumerator#chunk and slice_before return lazy Enumerators. [Bug #7715] * internal.h: Remove ref to rb_enum_cycle_size; no longer needed * enum.c: Make enum_cycle_size static. * test/ruby/test_lazy_enumerator.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05* enumerator.c: Finalize and document Lazy.new. [Bug #7248]marcandre
Add Lazy#to_enum and simplify Lazy#size. * test/ruby/test_lazy_enumerator.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05* enumerator.c: Fix and improve rdoc for to_enummarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24* enumerator.c (lazy_zip): raise error for bad argumentsmarcandre
[Bug #7706] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24* enumerator.c: Optimize Lazy#zip when passed only arraysmarcandre
[Bug #7706] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24* enumerator.c: Fix state handling for Lazy#zipmarcandre
[bug #7696] [bug #7691] * test/ruby/test_lazy_enumerator.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24* enumerator.c: Fix state handling for Lazy#dropmarcandre
[bug #7696] [bug #7691] * test/ruby/test_lazy_enumerator.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24* enumerator.c: Fix state handling for Lazy#drop_whilemarcandre
[bug #7696] [bug #7691] * test/ruby/test_lazy_enumerator.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24* enumerator.c: Fix state handling for Lazy#takemarcandre
[bug #7696] * test/ruby/test_lazy_enumerator.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14* enumerator.c (lazy_flat_map_func): flat_map should call each onlyshugo
when the value of a block returns a forcable object. [ruby-core:51401] [Bug #7690] * enumerator.c (lazy_flat_map): add documentation. * test/ruby/test_lazy_enumerator.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14* enumerator.c: Require block for Lazy#{take|drop}_while [Bug #7692]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14* enumerator.c: Fix size for Enumerator::Lazy#flat_mapmarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-13* enumerator.c: Fix rdoc typo (thanks to Yutaka HARA)marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29use RB_TYPE_Pnobu
* enumerator.c (enumerator_initialize), eval.c (rb_using_refinement), (add_activated_refinement), numeric.c (num_interval_step_size), parse.y (arg, match_op_gen, cond0), range.c (range_bsearch), vm_insnhelper.c (vm_get_iclass): use RB_TYPE_P() to optimize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01adjust style.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-07* include/ruby/intern.h: Restore rb_enumeratorize as it was before r37497marcandre
and introduce rb_enumeratorize_with_size instead. [#7302] * enumerator.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06enum.c: prefixnobu
* enum.c (rb_enum_cycle_size): prefix with rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06adjust stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support for lazy.cycle.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Add support for lazy.drop.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support for lazy.take.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support for lazy.{map|flat_map|...}.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support for lazy.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support #size for enumerators created from enumeratorsmarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c (obj_to_enum): Have #to_enum accept a blockmarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator: New method #size; constructor accepts sizemarcandre
[Feature #6636] * include/ruby/intern.h: RETURN_SIZED_ENUMERATOR for support of sized enumerators git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c (enumerator_initialize): Warn when using deprecated formmarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05obj_init_copynobu
* object.c (rb_obj_init_copy): should check if trusted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-13* enumerator.c (lazy_take_func, lazy_take): multiple calls ofnagachika
force/to_a method to Enumerator::Lazy#take should return same results. [ruby-dev:45634] [Bug #6428] * test/ruby/test_lazy_enumerator.rb (test_take_recycle): add test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03initialize IDs in advance.nobu
* enumerator.c (Init_Enumerator): initialize IDs in advance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03* enumerator.c (inspect_enumerator): suppress uninitializednobu
instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26* enumerator.c (inspect_enumerator): show method arguments ofshugo
lazy enumerators correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-24* enumerator (lazy_initialize): set the instance variable "receiver"shugo
to include the receiver to the return value of inspect on a lazy enumerator directly created by Enumerator::Lazy.new. * enumerator (RETURN_LAZY): don't set the instance variable "receiver". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-24* enumerator (enumerator_inspect): include the original receiver andshugo
method name of Enumerator::Lazy in the result of inspect. [ruby-core:43345] [Bug #6159] * enumerator (InitVM_Enumerator): don't use rb_define_alias for some methods such as collect in order to make rb_frame_this_func() return the correct method names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-19* enumerator.c (lazy_flat_map_func): convert the block value toshugo
Array if it doesn't respond to each. [ruby-core:43334] [Bug #6155] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-19* enumerator.c (enumerable_lazy): add an example of take and firstshugo
to the documentation. [ruby-core:43344] [Bug #6158] add the description of the behavior when a block is given to zip or cycle. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16follow r35040kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16* enumerator.c (lazy_take): don't enumerate an extra value.shugo
[ruby-dev:45370] [Bug #6152] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (lazy_zip_func): variadic argument needs explicit castnobu
on the platforms where VALUE is longer than int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (lazy_init_iterator): no need to check overflow twice.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e