summaryrefslogtreecommitdiffstats
path: root/array.c
Commit message (Collapse)AuthorAgeFilesLines
* * array.c (rb_ary_fill): doc for Array#fill misses indicationmatz2009-03-061-0/+1
| | | | | | about negative value for the start argument. [ruby-core:22497] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_index, rb_ary_rindex): Emit a warning that aknu2009-02-241-0/+4
| | | | | | | given block is unused when an argument is specified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_index, rb_ary_rindex): We know that argc is notknu2009-02-231-4/+4
| | | | | | | | | | | zero when we reach here. * array.c (rb_ary_initialize, rb_ary_index): Shrink a double space. (NFC) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-190/+190
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_resurrect), string.c (rb_str_resurrect): newnobu2009-02-181-0/+6
| | | | | | | | | | | functions based on [ruby-dev:37983] * insns.def (putstring, duparray): use rb_{ary,str}_resurrect(). * iseq.c (iseq_data_to_ary): needs to result TS_VALUE. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame2009-02-141-3/+3
| | | | | | | | | | | | include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784] * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash), string.c (rb_str_hsah), object.c (rb_obj_hash), range.c (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash), rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_uniq_bang, rb_ary_uniq): unique by the result ofnobu2009-02-141-17/+74
| | | | | | given block. [ruby-dev:37998] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_resize_capa): should not overwrite outside embeddednobu2009-02-141-1/+2
| | | | | | | array. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_make_shared): returns shared root array itself, andnobu2009-02-111-3/+15
| | | | | | | frozen array can be shared. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_uniq): gets rid of copying.nobu2009-02-051-6/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_add_hash): split from ary_make_hash().nobu2009-02-051-14/+30
| | | | | | | | | | | * array.c (ary_recycle_hash): clears internally used hash. this name came from [ruby-dev:37908]. * array.c (rb_ary_diff, rb_ary_and, rb_ary_or, rb_ary_uniq_bang): recycle hashes. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_make_hash): hide a Hash used internally.nobu2009-02-051-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * NEWS: add Array#sort_by!.kazu2009-02-031-2/+2
| | | | | | | * array.c (rb_ary_sort_by_bang): RDoc update. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_by_bang): RDoc update. [ruby-core:21742]matz2009-02-021-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_by_bang): new method. requested inmatz2009-02-021-0/+28
| | | | | | [ruby-core:21709] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_aset): fixed arguments evaluation order.nobu2009-01-261-1/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_double_capa): a new function to expand array morematz2009-01-211-13/+19
| | | | | | | | | | | | aggressively. [ruby-core:21460] * array.c (rb_ary_store): use ary_double_capa(). * array.c (rb_ary_unshift_m): ditto. * array.c (rb_ary_splice): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (take_items): to_ary() raises ArgumentError if cannot tousa2009-01-211-1/+1
| | | | | | | | convert to Array. [ruby-dev:37797] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (take_items), enum.c (enum_zip): tries to convert tonobu2009-01-191-1/+3
| | | | | | | array first. [ruby-core:21442] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_push_m): add modification check before actualmatz2008-12-171-0/+1
| | | | | | operation. [ruby-dev:37440] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_pop_m): use enum ary_take_pos_flags.matz2008-12-171-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_times): taint (and untrust) status should bematz2008-11-251-1/+5
| | | | | | inherited by "ary * 0". [ruby-dev:37024] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20050 from ruby_1_9_1 into trunk.yugui2008-11-081-6/+8
| | | | | | * array.c (rb_ary_sort_bang): refactoring. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_join): do not repeat self in a recursive array.nobu2008-11-031-1/+4
| | | | | | | [ruby-dev:37019] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_take_first_or_last): renamed rb_ary_partial moreyugui2008-11-031-10/+16
| | | | | | | | | | | appropriately. (ary_take_pos_flags): new enum. makes the fourth argument of rb_ary_take_first_or_last more descriptive. (rb_ary_partial): renamed rb_ary_partial0 more appropriately. takes a new parameter klass for what class to instanciate. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_partial0): recovers mistakenly feature change at r19723.yugui2008-10-311-1/+4
| | | | | | | | Array#[m,n] had returned an Array even for an instance of a subclass. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_decrement_share): fix to work recyclingwanabe2008-10-311-5/+11
| | | | | | | | shared-array without the following. [ruby-dev:36991] * array.c (ary_make_substitution): don't recycle substitution array. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_permutation): hide temporal array.mame2008-10-301-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): remove SEGV when replacing array withmame2008-10-291-3/+5
| | | | | | | | | embedded one during sort. * test/ruby/test_array.rb (test_sort!): add tests for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_splice): remove redundant check.mame2008-10-291-4/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): replacing array during sort brokemame2008-10-291-2/+6
| | | | | | | invariant of array. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * revert the previous wrong commit; sorry.mame2008-10-291-6/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): replacing array during sort brokemame2008-10-291-2/+6
| | | | | | | invariant of array. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): fixed sizes and randomness.nobu2008-10-241-17/+15
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: don't recycle shared-array while sort!.wanabe2008-10-171-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: recycle shared-array when it isn't referenced.wanabe2008-10-171-12/+80
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_resize_capa): renamed RESIZE_CAPA.yugui2008-10-171-11/+15
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (RESIZE_CAPA): check whether len is longer than capacity.usa2008-10-151-1/+2
| | | | | | | | * array.c (rb_ary_compact_bang): resize ary before changing capacity. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: embeds the elements of an array into itsyugui2008-10-091-129/+288
| | | | | | | | | | | | | | | | | | struct RArray for # of elements <= 3. * array.c: ditto. * gc.c (gc_mark_children): following the change of struct RArray. * ext/tk/tcltklib.c (ip_ruby_cmp): ditto. * parse.y (coverage): ditto. * proc.c (curry): ditto. * .gdbinit: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo.akr2008-09-071-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): performance improvement for huge array.nobu2008-08-201-18/+54
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): get rid of infinite loop. #455nobu2008-08-201-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18718 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
* * object.c (rb_obj_untrusted): new method Object#untrusted?.shugo2008-08-131-2/+9
| | | | | | | | | | | | | | | (rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_delete): Array#delete to return deleted element.matz2008-08-121-2/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): rename #choice to #sample. inmatz2008-08-111-9/+36
| | | | | | addition, sample takes optional argument, a la #first. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): reset to real class.nobu2008-08-051-1/+1
| | | | | | | | | * file.c (rb_find_file_ext, rb_find_file): ditto. * io.c (io_reopen): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): respect overridden <=> for String andnobu2008-08-041-10/+38
| | | | | | | | | | | | | | | Fixnum. [ruby-core:17708] * include/ruby/node.h (NOEX_BASIC): basic definition method flag. * include/ruby/intern.h, vm_method.c (rb_method_basic_definition_p): new function to check if the method is not redefined after the initialization. * vm_method.c (rb_obj_respond_to): use rb_method_basic_definition_p. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_tmp_new): added.nobu2008-08-041-0/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_fill): don't raise even if length is negative.akr2008-07-091-1/+3
| | | | | | | [ruby-core:17483], [ruby-core:17661] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e