summaryrefslogtreecommitdiff
path: root/array.c
AgeCommit message (Collapse)Author
2012-10-20* include/ruby/ruby.h: add C APIs.nari
VALUE rb_newobj_of(VALUE klass, VALUE flags) #define NEWOBJ_OF(obj,type,klass,flags) These allow to change a allocation strategy depending on klass or flags. * gc.c: ditto * array.c: use new C API. * bignum.c: ditto * class.c: ditto * complex.c: ditto * ext/socket/ancdata.c: ditto * ext/socket/option.c: ditto * hash.c: ditto * io.c: ditto * marshal.c: ditto * numeric.c: ditto * object.c: ditto * random.c: ditto * range.c: ditto * rational.c: ditto * re.c: ditto * string.c: ditto * struct.c: ditto [Feature #7177][Feature #7047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-09array.c: use rb_random_ulong_limitednobu
* array.c (rb_ary_sample): use rb_random_ulong_limited, since precision of long may be larger than double. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-20remove garbages.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-19array.c, enum.c: TypeError in zipnobu
* array.c (take_items), enum.c (enum_zip): raise TypeError at non-enumerable objects, not NoMethodError. [ruby-dev:46145] [Bug #7038] * vm_eval.c (rb_check_block_call): check_funcall variant with block function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-13* array.c (rb_ary_diff, rb_ary_uniq):zzak
Enhance documentation for array uniqueness Based on a patch by Robin Dupret [Bug #6872] [ruby-core:47209] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-13* array.c (rb_ary_select):zzak
Update documentation for Array#select * enum.c (enum_find_all, enum_reject): Update documentation for Enumerable#find_all and Enumerable#reject Based on a patch by Jeff Saracco [Bug #6908] [ruby-core:47285] [Fixes #166 on github] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17Add documentation about Array#join(nil). [Bug#5915]naruse
We talked about this and it is like following: * maybe ary.join(nil) should always use empty string as a separator, but it disables to specify $, as a seprator through variables. * if nil means '', the conversion is to_s. to_s is not accepted. * nil is a special value, so special behavior is allowed. * use of $ variables is not recommended, so it is not worth to change current behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-14array.c: fill with nilnobu
* array.c (rb_get_values_at): fill with nil out of range. [ruby-core:43678] [Bug #6203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-14array.c: no infection by unused separatornobu
* array.c (rb_ary_join): should not infected by separator if it is not used. [ruby-core:42161][Bug #5902] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-05* array.c (rb_ary_aref): Added a description of the behavior ofdrbrain
index positioning. [Bug #6680] * array.c (rb_ary_aset): ditto. Reordered sentences for clarity. * string.c (rb_str_aref_m): Added a description of the behavior of index positioning git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03* array.c (rb_ary_aref): Updated documentation to indicate thedrbrain
starting index is an index into the array or string. Updated examples to show behavior of indexes at the end of an array or string. Based on patch by Marcus Stollsteimer. [Bug #6680] * array.c (rb_ary_aset): ditto. * string.c (rb_str_aref): ditto. Also added descriptive argument names to call-seq section. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-19* array.c (ary_reverse): use ansi style declaration.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-31* array.c: Updated Array documentation formatting. Patch by Zacharydrbrain
Scott. [ruby-trunk - Feature #6517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-08* array.c (rb_ary_cat): new function to concat objects into array.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-10* array.c: Fix rdoc for Array#select!marcandre
patched by b t [ruby-core:42478] [Bug #5998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-05Fix typoayumin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-04* array.c (rb_ary_sample): add examples for Array#sample.ayumin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-15* array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.nobu
documentation from Thomas Leitner <t_leitner AT gmx.at> in [ruby-core:41616]. [Bug #5752] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-10* array.c (rb_ary_initialize): Improve explanation of Array.newdrbrain
parameters. Patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5425] * array.c (rb_ary_s_try_convert): Fix typo (try => tries) * array.c (rb_ary_rindex): Add spacing for block. * array.c (rb_ary_uniq_bang): Describe block * array.c (rb_ary_uniq): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-10* array.c: Add a description to Array, minor cleanups. Patch bydrbrain
Andrea Singh. [Ruby 1.9 - Bug #5412] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-06* array.c: Use + for arguments described in documentation to allowdrbrain
rdoc -C2 to work better. Remove <code> from method references to allow cross-references in HTML documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03* array.c (rb_ary_initalize): Make Array.new description matchdrbrain
call-seq. Patch by Henry Maddocks. [Ruby 1.9 - Bug #5344] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 * array.c (rb_ary_initialize): Add output for examples. Patch bydrbrain
Jonathan Mukai. [Ruby 1.9 - Bug #5216] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03* array.c (rb_ary_s_create): Add example results for Array::[]. Patchdrbrain
by Jonathan Mukai. [Ruby 1.9 - Bug #5215] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* array.c (ary_join_1): should not copy the encoding of non-stringnobu
element after string element. [ruby-core:39776] [Bug #5379] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29* array.c (rb_ary_set_len): new function to set array length.nobu
* vm_eval.c (method_missing): set the length of argv array, to mark arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26* array.c: Fix typo. https://github.com/ruby/ruby/pull/36shyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-21* array.c (rb_ary_delete_at_m): use simple array literal in rdoc.naruse
patched by samuel tonini. [ruby-core:38310] [Bug #5066] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-03* array.c (ary_reject_bang): should not remove elements which arenobu
not yielded. [Bug #2545] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-01* array.c (rb_ary_reject_bang, rb_ary_delete_if): rejectednobu
elements should be removed. fixed [Bug #2545] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-22* cont.c (cont_capture): add volatile.naruse
On clang -O, it is needed to avoid the optimization. With this and llvm/clang's recent fix, clang 3.0 can build ruby-trunk with -O option. * cont.c (cont_capture): use for-loop. * array.c (rb_ary_each): add volatile and use it. * vm_insnhelper.c (vm_call_cfunc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don'takr
declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 * array.c (rb_ary_drop): Improve documentation. Patch by Caley Woods.drbrain
[Ruby 1.9 - Bug #4858] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-22* array.c (rb_ary_sort_bang): fix rdoc.naruse
patched by burningTyger. https://github.com/ruby/ruby/pull/11 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-15* array.c (ary_join_1): fix array size.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-15* array.c (array_join): copy the encoding of the first element asnaruse
an initial encoding. * array.c (array_join_0): ditto. * array.c (array_join_1): ditto. * array.c (inspect_ary): ditto. * array.c (array_join_1): add an argument to check the appending is first one or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-15* array.c (inspect_ary): don't taint the inspected result of anaruse
recursive array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-09* array.c: documentation clarification in rotate, rotate!,kosaki
index, and rindex. [ruby-core:35144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-30Additional fix for r30736naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-30* array.c (rb_ary_uniq_bang): call ARY_SET_LEN(ary, 0) beforenaruse
rb_resize_capa because rb_resize_capa expects resized length is smaller than current array length. call rb_ary_unshare before rb_resize_capa because rb_resize_capa losts the reference to original shared array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-29* array.c (rb_ary_join): [].join.encoding must be US-ASCII.naruse
[ruby-list:47790] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-17* array.c (rb_ary_times): less MEMCPY calls.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-11fix typoskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-11* array.c (rb_ary_resize): should care of embeded array when extendingusa
the array. * array.c (rb_ary_resize): need to set capa when changing the real size of the array. these are latent bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05* array.c (rb_ary_modify): export.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05* array.c (rb_ary_resize): new utility function. [ruby-dev:42912]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-09* array.c (rb_ary_dup): should copy contents only. no instancematz
variable, no class would be copied. it would affect methods #sort, #reject, #transpose, #uniq, #compact, and #shuffle. [ruby-core:33640] * array.c (rb_ary_reverse_m): ditto. * array.c (rb_ary_rotate_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01* array.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e