summaryrefslogtreecommitdiff
path: root/enum.c
AgeCommit message (Collapse)Author
2015-05-12* enum.c (enum_to_a): fix incompatibility introduced in r50457.glass
[Bug #11130] * test/ruby/test_enum.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10* enum.c (enum_to_a): Use size to set array capa when possible.glass
the patch is from HonoreDB <aweiner at mdsol.com>. [fix GH-444] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10Revert "temp".glass
It's my fault. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10Revert "capa"glass
It's my fault. This reverts commit 5e17fc6bc7cb8b0e58b05fa9ebf2c47ec73ecbb3. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10Revert "temp"glass
This reverts commit 3482910fc4ca8515b38f56bdd9fa0db7002413ad. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10capaglass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10tempglass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-06* enum.c: Enumerable#chunk and Enumerable#slice_before no longer takesakr
the initial_state argument. [Feature #10958] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18* enum.c (enum_sort_by): add WBs.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-14* enum.c: [DOC] Fixes Enumerable#member? documentationgogotanaka
[fix GH-756][ci skip] Patch by @shamanime git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* internal.h: use T_IMEMO to represent `struct MEMO' value.ko1
memo->v1 and memo->v2 is WB protected values. So use MEMO_V1/V2_SET() macros to set these values. memo->u3 is ambiguous (sometimes a VALUE, sometimes an integer value), so use gc_mark_maybe() in gc.c to mark it. Rename NEW_MEMO() to MEMO_NEW(). Move MEMO_FOR and NEW_MEMO_FOF macros from node.h. Export a rb_imemo_new() function for ext/ripper. * node.h: remove NODE_MEMO. * enum.c: catch up these change. * enumerator.c: ditto. * load.c: ditto. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c (gc_mark_children): mark imemo_memo type. * parse.y (new_args_gen): use T_IMEMO. (I'm not sure it is working correctly...) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* internal.h: define struct MEMO.ko1
* enum.c: use MEMO. * enumerator.c: ditto. * load.c: ditto. * node.h: return (struct MEMO *) pointer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10* enum.c (enum_slice_when): [DOC] fix typo.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-04* enum.c: Fix typo in slice_after's exception message.hsbt
[fix GH-842][ci skip] Patch by @jsyeo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-28enum.c: Fixnum onlynobu
* enum.c (limit_by_enum_size, enum_size_over_p): check only against Fixnum size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-28enum.c: limit sizenobu
* enum.c (enum_each_slice, enum_each_cons): limit elements size by the enumerator size. suggested by Hans Mackowiak <hanmac AT gmx.de> at [ruby-core:68335] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16use rb_funcallvnobu
* use rb_funcallv() for no arguments call instead of variadic rb_funcall(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12[DOC]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18* internal.h: Gather declarations in non-header files.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15enum.c: nil if no iterationnobu
* enum.c (enum_inject): return nil if no iteration, instead of Qundef. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-15enum.c: use Qundefnobu
* enum.c (enum_inject): use Qundef for no initial values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14* enum.c: min(n) drops elements bigger than the n-th maximum element.akr
(struct nmin_data): New field to record the n-th maximumelement, limit (nmin_filter): Update limit field. (nmin_i): Drop too big eleents. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13* enum.c (nmin_run): max(n) and max_by(n) returns an array inakr
descending order. [ruby-core:65452] Suggested by David Grayson. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-10Update doc. and warnings.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-20* enum.c (enum_chunk): Deprecate the state management.akr
(enum_slice_before): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-20* enum.c (enum_slice_when): New method: Enumerable#slice_when.akr
(slicewhen_i): New function. (slicewhen_ii): New function. * enumerator.c (InitVM_Enumerator): New method: Enumerator::Lazy#slice_when. [ruby-core:62499] [Feature #9826] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-06Move enum.one? documentation before the relevant method.knu
* enum.c (enum_one): Move enum.one? documentation before the relevant method. Submitted by @vipulnsward. [Fixes GH-687] https://github.com/ruby/ruby/pull/687 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-28symbols instead of IDsnobu
* encoding.c (rb_enc_get_index): deal with symbols instead of IDs to get rid of inadvertent pin-downs. * enum.c (chunk_ii): ditto. * enumerator.c (append_method): ditto. * iseq.c (iseq_load): ditto. * marshal.c (w_symbol, r_symlink, r_symreal, r_symbol): ditto. * signal.c (trap_handler): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-18revert r46859 and r46860nobu
revert "enum.c: optimize any? object allocations for Array and Hash" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-18enum.c: optimize any? object allocations for Array and Hashnobu
* enum.c (enum_any): optimize object allocations for Array and Hash when `each` is not redefined, always false if empty and the case without a block. [fix GH-617] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25* enum.c: [DOC] Use #find in example to clarify alias by @rachellogiezzak
Patch submitted via documenting-ruby/ruby#34 [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18enum.c: suppress warningsnobu
* enum.c (sliceafter_ii): suppress unused-value warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18* enum.c: Enumerable#slice_after implemented.akr
* enumerator.c: Enumerator::Lazy#slice_after implemented. Requested by Tsuyoshi Sawada. [ruby-core:58123] [Feature #9071] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-05[DOC]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-16enum.c: fix condition to recycle block argumentnobu
* enum.c (dont_recycle_block_arg): fix condition to recycle block argument. lambda with rest can get internal array directly. [ruby-core:62060] [Bug #9749] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-15enum.c: make each_slice and each_cons more efficientnobu
* enum.c (enum_each_slice, enum_each_cons): make more efficient by allocating less and recycling block argument arrays if possible. [Fixes GH-596] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-12revert [Bug #9605]nobu
* enum.c: revert r45284, r45286, r45292. it conflicts with existing behaviors. [Bug #9605] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-08enum.c: suppress warningsnobu
* enum.c (each_val_i): svalue is no longer used. [ruby-core:61340] [Bug #9605] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-07enum.c: yield multiple valuesnobu
* enum.c (find_i): yield multiple values instead of a packed array, so that lambda block can work. with tests by Alex Rothenberg. [ruby-core:61340] [Bug #9605] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14* enum.c: Enumerable#{min,min_by,max,max_by} extended to take anakr
optional argument. (nmin_cmp): New function. (nmin_block_cmp): Ditto (nmin_filter): Ditto. (nmin_i): Ditto. (nmin_run): Ditto. (enum_min): Call nmin_run if the optional argument is given. (nmin_max): Ditto. (nmin_min_by): Ditto. (nmin_max_by): Ditto. * range.c: Range#{min,max} extended to take an optional argument. (range_min): Call range_first if the optional argument is given. (range_max): Call rb_call_super if the optional argument is given. [ruby-core:57111] [Feature #8887] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-10* enum.c: document that it is OK to take more than available by @mvidner ↵hsbt
[fix GH-525] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-21* enum.c: [DOC] Add simple example of Enumerable#zip [ci skip]zzak
Patch by @nruth on documenting-ruby/ruby#22 https://github.com/documenting-ruby/ruby/pull/22 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-23* array.c: Have to_h raise on elements that are not key-value pairs [#9239]marcandre
* enum.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11* array.c: More doc examples for Array#{map|collect}{!} using both formsmarcandre
* enum.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h, enum.c, vm_eval.c: constify argvnobu
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): constify argv. * enum.c (rb_enum_values_pack): ditto. * vm_eval.c (rb_block_call, rb_check_block_call): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLISTnobu
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration argument list of rb_block_call_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29array.c, enum.c, range.c: rb_block_call_func compatiblenobu
* array.c (take_i), range.c (first_i): make rb_block_call_func compatible. * enum.c (collect_all, DEFINE_ENUMFUNCS): add blockarg. * enum.c ({min,max,minmax,chunk,slicebefore}_ii): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h: add blockarg to rb_block_call_funcnobu
* include/ruby/ruby.h (rb_block_call_func): add blockarg. block function can take block argument, e.g., proc {|&blockarg| ...}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e