summaryrefslogtreecommitdiffstats
path: root/enum.c
Commit message (Collapse)AuthorAgeFilesLines
* * enum.c (slicebefore_ii): use id_eqq.akr2009-10-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enum.c (enum_chunk): Give proper error message if no block given. cf ↵marcandre2009-10-031-0/+2
| | | | | | [ruby-core:25912] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-10-021-13/+14
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-10-021-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_slice_before): take a pattern if no block given.akr2009-10-021-18/+40
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2009-10-021-0/+12
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-09-271-0/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_minmax): use struct for memo.akr2009-09-271-73/+92
| | | | | | | (enum_minmax_by): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix rdoc.akr2009-09-271-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-09-251-15/+18
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-09-241-18/+48
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_minmax): reduce comparison.akr2009-09-231-36/+135
| | | | | | | (enum_minmax_by): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_chunk): new method Enumerable#chunk.akr2009-09-221-0/+325
| | | | | | | | * enum.c (enum_slice_before): new method Enumerable#slice_before. [ruby-dev:38392] [ruby-dev:39240] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (recursive_join): use obj to tell if recursion occurs.nobu2009-07-101-30/+1
| | | | | | | | | [ruby-core:24150] * enum.c (enum_join): reverted r23966. [ruby-core:24196] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (DEFINE_ENUMFUNCS): included function signature.nobu2009-07-071-21/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (rb_enum_join): non-nil separator must be convertible tonobu2009-07-071-0/+1
| | | | | | | String. [ruby-core:24172] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (rb_enum_join): should propagate taint to the returnmatz2009-07-071-1/+5
| | | | | | value. the change was overridden by r23967. [ruby-core:24176] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_to_a): should propagate taint to the return value.matz2009-07-061-0/+4
| | | | | | | | [ruby-core:24152] * enum.c (enum_sort_by): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_join): deals with self recursive objects to get ridnobu2009-07-061-1/+25
| | | | | | | of infinite recursion. [ruby-core:24150] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_join): added rdoc.nobu2009-07-051-0/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_join): add Enumerable#join.matz2009-07-031-0/+12
| | | | | | | | | * array.c (ary_join_1): recursive join for Enumerators (and objects with #to_a). * array.c (rb_ary_join): performance tune. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_grep): gets rid of type-punning calls.nobu2009-06-301-2/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (first_i): wrong condition for no argument #first.matz2009-06-241-12/+12
| | | | | | [ruby-core:24017] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_first): should check negative length.matz2009-06-031-0/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (first_i): Enumerator#first should consume only what ismatz2009-06-031-6/+10
| | | | | | | | | needed. a patch from Marc-Andre Lafortune. [ruby-core:23661] * enum.c (enum_first): call to_int once for an argument. based on a patch from Marc-Andre Lafortune. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (collect_all): checks interrupts. [ruby-core:23594]nobu2009-05-291-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (zip_ary): should use long.nobu2009-05-201-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (take_items), enum.c (enum_zip): tries to convert tonobu2009-01-191-2/+6
| | | | | | | array first. [ruby-core:21442] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, node.h: move node.h from include path.ko12008-09-231-1/+1
| | | | | | | | | | | | | | This change stop to install node.h beacuase of saving ABI (node.h will be changed. Extensions should not depends on this file). * blockinlining.c, class.c, compile.c, debug.h, enum.c, gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c, vm.c, vm_core.h, vm_dump.c: ditto. * ext/ripper/depend: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_take): get rid of extraneous iteration.nobu2008-08-201-2/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu2008-08-161-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (sort_by_i): use NODE_DOT2 instead of NODE_MEMO to avoidmatz2008-06-131-2/+4
| | | | | | | | extra calls to is_pointer_to_heap() in GC. * enum.c (enum_zip): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-1/+3
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_count, count_all_i, Init_Enumerable),knu2008-05-291-5/+27
| | | | | | | | array.c (rb_ary_count): If no argument or block is given, count the number of all elements. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_to_a): Pass arguments through to #each().knu2008-05-271-5/+31
| | | | | | | | (enum_sort): Follow the enum_to_a signature change. (enum_reverse_each): Add #reverse_each(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Cosmetic.knu2008-05-271-33/+33
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_yield): use rb_yield_values2.nobu2008-05-131-54/+26
| | | | | | | | | | | * enum.c (DEFINE_ENUMFUNCS): macro to define enumerator and yielding functions. * enum.c (enum_all_func, enum_any_func, enum_one_func, enum_none_func): reduced duplicate code. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (grep_i): Be aware of multiple values;knu2008-05-121-50/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix [ruby-dev:34653]. (grep_iter_i): Ditto. (count_i): Ditto. (find_i): Ditto. (find_index_i): Ditto. (find_all_i): Ditto. (reject_i): Ditto. (inject_i): Ditto. (inject_op_i): Ditto. (partition_i): Ditto. (group_by_i): Ditto. (first_i): Ditto. (sort_by_i): Ditto. (all_i): Ditto. (all_iter_i): Ditto. (any_i): Ditto. (any_iter_i): Ditto. (one_i): Ditto. (one_iter_i): Ditto. (none_i): Ditto. (none_iter_i): Ditto. (min_i): Ditto. (min_ii): Ditto. (max_i): Ditto. (max_ii): Ditto. (minmax_i): Ditto. (minmax_ii): Ditto. (min_by_i): Ditto. (max_by_i): Ditto. (minmax_by_i): Ditto. (member_i): Ditto. (take_i): Ditto. (take_while_i): Ditto. (drop_i): Ditto. (drop_while_i): Ditto. (cycle_i): Ditto. * enum.c (each_with_index): Update rdoc. each_with_index() takes argments that are passed through to each(), and a hash preserves key order. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (all_iter_i, any_iter_i): reduced duplicated code.nobu2008-05-111-16/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c: removed trailing garbage spaces.nobu2008-05-111-110/+110
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_cycle): Make Enumerable#cycle do a finite loop whenknu2008-04-131-10/+25
| | | | | | | | | the number of cycles is specified. * array.c (rb_ary_cycle): Ditto for Array#cycle. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (count_i): modified to shut warning up.matz2008-04-111-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (count_i, count_iter_i, enum_count, enum_find_index):knu2008-04-111-33/+25
| | | | | | | Reduce code. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (find_index_i): modified to shut warning up.matz2008-04-111-2/+5
| | | | | | * enum.c (find_index_iter_i): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_find_index): Add support for find_index(obj);knu2008-04-111-15/+44
| | | | | | | | | [ruby-dev:34313]. * array.c (rb_ary_index): Define find_index as an alias to index. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_new): fix size check. [ruby-dev:34123]mame2008-03-251-4/+14
| | | | | | | | | | | | * array.c (rb_ary_take, rb_ary_drop): check negative size and use NUM2LONG instead of FIX2LONG. [ruby-dev:34123] * enum.c (enum_take, enum_drop): check negative size. * test/ruby/test_array.rb: add tests for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (zip_ary): wrong boundary condition.matz2008-03-131-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_zip): optimize if all arguments are arrays.matz2008-03-111-3/+42
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e