aboutsummaryrefslogtreecommitdiffstats
path: root/enum.c
Commit message (Collapse)AuthorAgeFilesLines
...
* rdoc update.akr2010-03-131-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_join): remove Enumerable#join. [ruby-core:24786]matz2010-03-131-20/+0
| | | | | | * array.c (ary_join_1): use #to_ary to detect recursive array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2010-03-121-9/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (min_ii, max_ii, minmax_ii): remove wrong optimization thatmame2010-03-101-37/+16
| | | | | | | reuses array for yield parameter, which caused unexpected behavior. [ruby-core:25989] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enumerator.c: move implementation of each_slice, each_cons,matz2010-02-031-0/+144
| | | | | | | | | | | | | each_with_object to enum.c. * enum.c (each_slice_i): convert multiple values from yield into an array. * enum.c (each_cons_i): ditto. * enum.c (each_with_object_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* unused variable removed.akr2010-02-021-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_each_entry): new method #each_entry to pack valuesmatz2010-02-021-0/+41
| | | | | | | | | | | | | | from yield into an array. * lib/set.rb (Set#merge): use Enumerable#each_entry to implement Set compatible to 1.8 behavior. [ruby-core:27985] * lib/set.rb: replace is_a?(Enumerable) with respond_to?(:each) for duck typing. * lib/set.rb (SortedSet#add): typo fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_count): remove optimization using #size.matz2009-10-311-6/+0
| | | | | | | | revert r25560. * vm_eval.c (rb_funcall_no_recursive): remove method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_count): call #size using rb_funcall_no_recursive()matz2009-10-291-2/+4
| | | | | | | | | | | to prevent infinite recursive calls. [ruby-core:24794] * vm_eval.c (rb_funcall_no_recursive): utility function to check direct recursive call. * vm_eval.c (rb_check_funcall): move from eval.c. [refactoring] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_to_ary): do not use #respond_to? to detectmatz2009-10-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to_ary. Just call. [ruby-core:23738] * eval.c (rb_check_funcall): new function with method existence check. returns Qundef when the method does not exist. * enumerator.c (enumerator_rewind): just call method, using rb_check_funcall(). [ruby-core:23738] * error.c (exc_equal): ditto. * object.c (convert_type): ditto. * error.c (rb_name_err_mesg_new): export function. * eval.c (make_exception): ditto. * io.c (pop_last_hash): return early when the last argument is nil. * io.c (rb_io_puts): treat T_STRING specially for small optimization. * vm_eval.c (raise_method_missing): skip method call if possible using rb_method_basic_definition_p(). * vm_eval.c (method_missing): ditto. * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_debug): test suites changed to ignore exceptions caused by just-call policy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_flat_map): new method that concatenates the valuesmatz2009-10-241-0/+44
| | | | | | from given block. also provides alias #collect_concat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-10-111-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (slicebefore_ii): use id_eqq.akr2009-10-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-10-021-13/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-10-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2009-10-021-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-09-271-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix rdoc.akr2009-09-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-09-251-15/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-09-241-18/+48
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@24017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (DEFINE_ENUMFUNCS): included function signature.nobu2009-07-071-21/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@23966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_join): added rdoc.nobu2009-07-051-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@23846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_first): should check negative length.matz2009-06-031-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@23603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (zip_ary): should use long.nobu2009-05-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@16622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e