summaryrefslogtreecommitdiff
path: root/array.c
AgeCommit message (Collapse)Author
2013-03-27* array.c (rb_ary_collect), enum.c (enum_collect): rb_warn() is aknu
bit too noisy when RubyGems, so change it to rb_warning(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@39959 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/branches/ruby_1_8@32373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-01* array.c (ary_reject): fix internal function name.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@32364 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/branches/ruby_1_8@32360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-03* array.c (rb_ary_collect), enum.c (enum_collect): Addknu
compatibility warnings for a call without a block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@31013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-17* array.c (rb_ary_sort_by_bang): Add Array#sort_by!.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-28 * array.c (rb_ary_product): Use tmpary instead, to ensure markingshyouhei
arrays by GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-06* array.c (rb_ary_sample): Fix infinite loop bug [ruby-core:27075]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-28* time.c: rdoc fix for <=>marcandre
* array.c: ditto * bignum.c: ditto * compar.c: ditto * file.c: ditto * numeric.c: ditto * string.c: rdoc fix for <=> and casecmp git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-22* *.[chy]: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23* array.c (ary_resize_capa): Remove an unused function.knu
* array.c, bignum.c, dir.c, enumerator.c, gc.c, io.c, numeric.c, object.c, re.c, string.c, struct.c: Mixing two styles is not a good thing. Stick with the K&R style in 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-20* array.c (Array#try_convert): New method backported from 1.9.knu
* hash.c (Hash#try_convert): New method backported from 1.9. * io.c (IO#try_convert): New method backported from 1.9. * re.c (Regexp#try_convert): New method backported from 1.9. * string.c (String#try_convert): New method backported from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-26* array.c (rb_ary_aset): fixed arguments evaluation order.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-21* array.c (ary_double_capa): a new function to expand array morematz
aggressively. [ruby-core:21460] * array.c (rb_ary_store): use ary_double_capa(). * array.c (rb_ary_splice): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-16* array.c (rb_ary_nitems, rb_ary_choice): Add a deprecationknu
warning. * hash.c (env_index, rb_hash_index): Simplify the deprecation warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-03* array.c (rb_ary_join): do not repeat self in a recursive array.nobu
[ruby-dev:37019] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12* array.c (rb_ary_choice): Resurrect #choice. Let me think aboutknu
it for a while. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12* array.c (rb_ary_sample): rename #choice to #sample. inmatz
addition, sample takes optional argument, a la #first. * random.c (Init_Random): always initialize seed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-09* array.c (rb_ary_fill): don't raise even if length is negative.akr
[ruby-core:17483], [ruby-core:17661] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01* array.c (rb_ary_fill): check if beg is too big.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29* array.c (rb_ary_fill): check for negative length.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-25* array.c (rb_ary_fill): not depend on unspecified behavior at integernobu
overflow. reported by Vincenzo Iozzo <snagg AT openssl.it>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-20* array.c (rb_ary_store, rb_ary_splice): not depend on unspecifiednobu
behavior at integer overflow. * string.c (str_buf_cat): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19* array.c (ary_new, rb_ary_initialize, rb_ary_store,shyouhei
rb_ary_aplice, rb_ary_times): integer overflows should be checked. based on patches from Drew Yao <ayao at apple.com> fixed CVE-2008-2726 * string.c (rb_str_buf_append): fixed unsafe use of alloca, which led memory corruption. based on a patch from Drew Yao <ayao at apple.com> fixed CVE-2008-2726 * sprintf.c (rb_str_format): backported from trunk. * intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31* array.c (rb_ary_delete_if): should return enumerator if no blockknu
is given. [ruby-dev:34901] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29* enum.c (count_i, count_iter_i): Sync with trunk.knu
enum.c (enum_count, count_all_i, Init_Enumerable), array.c (rb_ary_count): Sync with trunk. If no argument or block is given, count the number of all elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29Fix a typo.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-28* array.c (rb_ary_slice_bang): Call rb_ary_modify_check() at theknu
beginning. [rubyspec] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27* array.c (rb_ary_slice_bang): Return an empty array instead ofknu
nil when pos is valid and len is adjusted from a valid value to zero; caught by RubySpec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24* array.c (rb_ary_slice_bang): Be consistent with Array#slice()knu
and String#slice!(). Just return nil when a negative length or out of boundary index is given instead of raising an exception via internal functions. (rb_ary_slice_bang): should not use rb_ary_subseq() which shares internal pointer. splice modifies the receiver right after subseq. [ruby-dev:34005] (rb_ary_slice_bang): should adjust length before making sub-array. * enumerator.c (Init_Enumerator): Override Enumerable::Enumerator#each_with_index with #with_index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22* array.c (flatten): check if reentered. [ruby-dev:34798]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22* array.c (flatten): free memo hash table before raising exception.matz
[ruby-dev:34789] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21* array.c (flatten): fix memory leak.nagai
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-14* array.c (rb_ary_count): Override Enumerable#count for betterknu
performance. (rb_ary_nitems): Undo the backport. Use #count {} instead. * enumerator.c (enumerator_iter_i): Remove an unused function. (enumerator_with_index, enumerator_each): Remove unused variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-25* array.c (flatten): returns an instance of same class.nobu
[ruby-core:16554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-19* array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp):knu
Make Array#eql?, #hash, #== and #<=> use rb_exec_recursive() and handle recursive data properly. * hash.c (hash_equal, rb_hash_hash): Make Hash#eql?, #hash and #== use rb_exec_recursive() and handle recursive data properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15* array.c (rb_ary_take_while, rb_ary_drop_while): removed unusednobu
variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14* array.c (rb_ary_flatten, rb_ary_flatten_bang): Take an optionalknu
argument that determines the level of recursion to flatten; backported from 1.9. * array.c (rb_ary_shuffle_bang, rb_ary_shuffle, rb_ary_choice, rb_ary_cycle, rb_ary_permutation, rb_ary_combination, rb_ary_product, rb_ary_take, rb_ary_take_while, rb_ary_drop, rb_ary_drop_while): New methods: Array#shuffle, #shuffle!, #choice, #cycle, #permutation, #combination, #product, #take, #take_while, #drop, #drop_while; backported from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14* array.c (rb_ary_collect_bang, rb_ary_select): Return anknu
enumerator if no block is given. * dir.c (dir_each, dir_foreach): Return an enumerator if no block is given. * enum.c (enum_partition, enum_sort_by): Ditto. * gc.c (os_each_obj): Ditto. * hash.c (rb_hash_delete_if, rb_hash_reject_bang, rb_hash_select, rb_hash_each_value, rb_hash_each_key, rb_hash_each_pair, env_each_key, env_each_value, env_each, env_each_pair, env_reject_bang, env_delete_if, env_select): Ditto. * numeric.c (num_step, int_upto, int_downto, int_dotimes): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14* enum.c (enum_count, enum_find_index): New methods:knu
Enumerable#count and #find_index; backported from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-10* array.c (rb_ary_first, rb_ary_last): Return a shared array whenknu
possible. * array.c (rb_ary_pop, rb_ary_pop_m, rb_ary_shift, rb_ary_shift_m): Array#pop and Array#shift can take an optional argument specifying the number of elements to remove and return; backported from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-09Fix a typo.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-09* array.c (rb_ary_pop): Do not reallocate too often; backportedknu
from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-09Array#reject too.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-09* array.c (rb_ary_each, rb_ary_each_index, rb_ary_reverse_each,knu
rb_ary_reject_bang): Calling Array#each, #each_index, #reverse_each, #reject! or #delete_if without a block now returns an enumerator; backported from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-09* array.c (rb_ary_index, rb_ary_index): Array#index and #rindexknu
take a block instead of an argument; backported from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-07* array.c (rb_ary_nitems): Backport Array#nitems with a block;knu
suggested by Bertram Scharpf <[email protected]> in [ruby-talk:134083]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-10* array.c (rb_ary_slice_bang): If an invalid negative index (<=knu
-size) is given, do not raise an exception but return nil just like slice() does. * test/ruby/test_array.rb (TestArray::test_slice, TestArray::test_slice!): Pull in test cases from trunk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-02* array.c (rb_ary_assoc): check and convert inner arrays (assocs)matz
using #to_ary. * hash.c (rb_hash_s_create): check and convert argument hash using #to_hash. * hash.c (rb_hash_s_create): Hash#[] now takes assocs as source of hash conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-05* array.c (rb_ary_subseq): need integer overflow check.matz
[ruby-dev:31736] * array.c (rb_ary_splice): ditto. [ruby-dev:31737] * array.c (rb_ary_fill): ditto. [ruby-dev:31738] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e