summaryrefslogtreecommitdiffstats
path: root/array.c
Commit message (Collapse)AuthorAgeFilesLines
* * array.c (rb_ary_to_ary): do not use #respond_to? to detectmatz2009-10-291-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@25556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: rdoc for <=>, casecmpmarcandre2009-10-281-1/+1
| | | | | | | | | | | | * bignum.c: rdoc for <=> * file.c: ditto * time.c: ditto * compar.c: rdoc git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_cmp): Array#<=> returns nil when comparison failsmarcandre2009-10-261-2/+3
| | | | | | [ruby-core:26316] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_{times, shuffle_bang, sample}): reducing macromatz2009-10-051-11/+20
| | | | | | | | | | | | | calls inside of the loop by keeping pointers in local variables. a patch from Masahiro Kanai (CanI) in [ruby-dev:39406]. It was found and fixed at Security and Programming camp 2009. * string.c (rb_str_{times, split_m}): ditto. * struct.c (rb_struct_{getmember, set, aref_id, aset_id}, {make, inspect}_struct, recursive_{equal, hash, eql}): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_make_shared): should count frozen array itself.nobu2009-10-021-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_exec_recursive_outer, rb_exec_recursive): Added method to ↵marcandre2009-09-151-6/+8
| | | | | | | | | | | | | | | | | | short-circuit to the outermost level in case of recursion * test/ruby/test_thread.rb (test_recursive_outer): Test for above * hash.c (rb_hash_hash): Return a sensible hash for in case of recursion [ruby-core:24648] * range.c (rb_range_hash): ditto * struct.c (rb_struct_hash): ditto * array.c (rb_array_hash): ditto * test/ruby/test_array.rb (test_hash2): test for above git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_hash_func): use st_index_t.nobu2009-09-081-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (permute0): use chars for boolean array.nobu2009-08-031-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_{permutation,combination}): disallow reentrancenobu2009-08-031-8/+16
| | | | | | | with continuation since work-buffers cannot restore. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_{permutation,combination,product}): must not usenobu2009-08-031-5/+5
| | | | | | | ary_discard on strings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_combination, rb_ary_product): prevent from GC.nobu2009-08-021-2/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: suppressed shorten-64-to-32 warnings.nobu2009-07-181-8/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (recursive_hash): reject recursive key.akr2009-07-171-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (recursive_join): raise ArgumentError for joiningmatz2009-07-171-3/+2
| | | | | | | | | | | recursive array. * array.c (ary_join_1): ditto. * test/ruby/test_array.rb (TestArray#test_join2): test updated for recursive join. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): RDoc update. a patch from Florianmatz2009-07-161-3/+5
| | | | | | Frank. [ruby-core:24347] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_join_1): should recurse for element array.nobu2009-07-101-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (recursive_join): use obj to tell if recursion occurs.nobu2009-07-101-5/+6
| | | | | | | | | [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 (enum_join): add Enumerable#join.matz2009-07-031-32/+91
| | | | | | | | | * 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
* * array.c (rb_ary_memsize): added.ko12009-06-161-0/+11
| | | | | | | | | | | | * io.c (rb_io_memsize): added. * regcomp.c (onig_memsize): added. * string.c (rb_str_memsize): added. * transcode.c (rb_transcoding_memsize, rb_econv_memsize): added. * variable.c (rb_geneic_ivar_memsize): added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_exec_recursive_paired): new function for propernobu2009-05-241-6/+6
| | | | | | | | | | | handling of recursive arrays. [EXPERIMENTAL] [ruby-core:23402] * array.c (rb_ary_equal, rb_ary_eql, rb_ary_cmp): use above. * hash.c (hash_equal): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_slice_bang): avoid call of rb_scan_args() unlessmatz2009-05-211-3/+9
| | | | | | it's really necessary. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_shift, rb_ary_shift_m): clears unused elements.nobu2009-05-151-0/+6
| | | | | | | [ruby-dev:38448] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename argument name.akr2009-05-091-10/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_flatten_bang): clears temporary array.nobu2009-05-081-2/+15
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_flatten_bang): returns nil if nothing changed.nobu2009-05-071-1/+1
| | | | | | | a patch from Marc-Andre Lafortune in [ruby-core:23382]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): negative sample number is invalid.nobu2009-05-071-0/+1
| | | | | | | [ruby-core:23374] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (Init_Array): made #to_s an alias to #inspect to reducenobu2009-05-021-1/+1
| | | | | | | | the result of recursive array. a patch from ujihisa at [ruby-dev:38362] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: fixed types.nobu2009-05-021-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_push): bypass rb_ary_store().matz2009-04-201-1/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_flatten): flatten(0) works as Array#dup.mame2009-04-151-1/+7
| | | | | | | | | [ruby-core:23168] * test/ruby/test_array.rb: add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu2009-03-121-3/+3
| | | | | | | | | | numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,nobu2009-03-101-9/+9
| | | | | | | missing/crypt.c, missing/vsnprintf.c, : suppress warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 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