summaryrefslogtreecommitdiff
path: root/enumerator.c
AgeCommit message (Collapse)Author
2013-08-27enumerator.c: rb_check_funcallnobu
* enumerator.c (enumerator_size): use rb_check_funcall() instead of respond_to? and call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-27enumerator.c: add commentnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-27enumerator.c: check arg sizenobu
* enumerator.c (enumerator_each): ensure argument array size is int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-27* enumerator.c: Allow Enumerator size argument to be any callable.marcandre
Patch by Avdi Grimm. [bug #8641] [ruby-core:56032] [fix GH-362] * test/ruby/test_enumerator.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-08enumerator.c: fix non-single argumentnobu
* 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/trunk@42450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-04* enumerator.c: [DOC] Remove reference to Enumerator::Lazy#cyclezzak
Patch by @kachick [Fixes GH-372] https://github.com/ruby/ruby/pull/372 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29Add a frozenness check to Enumerator::Generator#initialize.knu
* enumerator.c (generator_init): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29Add a frozenness check to Enumerator#initialize.knu
* enumerator.c (enumerator_init): Add a frozenness check to prevent a frozen Enumerator object from being reinitialized with a different enumerable object. This is the least we should do, and more fixes will follow. [Fixes GH-368] Patch by Kenichi Kamiya. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-28enumerator.c: lazyenum_sizenobu
* enumerator.c (lazyenum_size): adjust arguments. * enumerator.c (enumerable_lazy): use lazyenum_size() instead of enum_size(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-27enumerator.c: adjust indentnobu
* enumerator.c (rb_enumeratorize_with_size): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-26enumerator.c: use rb_enumerator_size_funcnobu
* enumerator.c (rb_enumeratorize_with_size): use strict definition rb_enumerator_size_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-26intern.h: define rb_enumerator_size_funcnobu
* include/ruby/intern.h (rb_enumerator_size_func): define strict function declaration for rb_enumeratorize_with_size(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-21Update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18enumerator.c: use VALUEnobu
* enumerator.c (inspect_enumerator): use VALUE instead of mere char* by using rb_sprintf() and rb_id2str(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18enumerator.c: append_methodnobu
* enumerator.c (append_method): extract from inspect_enumerator(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18enumerator.c: fix stylenobu
* enumerator.c (enumerator_initialize): no cuddle up else. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-12* array.c: Document synonymous methods, by windwiny [GH-277]zzak
* bignum.c: ditto * complex.c: ditto * dir.c: ditto * encoding.c: ditto * enumerator.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * string.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-11* enumerator.c (enumerator_with_index): try to convert given offset tonaruse
integer. fix bug introduced in r39594. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-05use INT2FIX(0) instead of INT2NUM(0).kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-05* enumerator.c (enumerator_with_index): Restore handling of a nil memodrbrain
from r39594. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-05enumerator.c: allow Bignum for with_indexnobu
* enumerator.c (enumerator_with_index_i): allow Bignum as offset, to get rid of conversion exception and integer overflow. [ruby-dev:47131] [Bug #8010] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-23* enumerator.c: rdoc fixmarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-20enumerator.c: suppress warningsnobu
* 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/trunk@39329 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