| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
| |
This PR creates doc/bsearch.rdoc to provide common documentation for bsearch in Array and Range.
|
| |
|
|
|
|
| |
Must not be a bad idea to improve documents. [ci skip]
|
|
|
|
|
|
|
| |
This prevents early collection of the array. The GC doesn't see the
array on the stack when Ruby is compiled with optimizations enabled
[ruby-core:105099] [Bug #18140]
|
| |
|
|
|
|
|
|
|
|
|
| |
Commit 4f24255 introduced a bug which allows a length to be passed to
rb_ary_new4 which is too large, resulting in invalid memory access.
For example:
(1..1000).to_a.slice!(-2, 1000)
|
| |
|
|
|
|
|
| |
Because the key of redefine table is `def`, `def` should be
unique for each optimized method (`alias` is not allowed).
|
| |
|
|
|
|
|
|
|
|
|
| |
* --braces-after-func-def-line
* --dont-cuddle-else
* --procnames-start-lines
* --space-after-for
* --space-after-if
* --space-after-while
|
|
|
|
|
|
|
|
|
| |
If freezing an array inside sort!, previously the array could be
modified after the freeze. This checks whether the receiver is
frozen after every yield and potential call to #> or #<,
preventing modifications if the receiver is frozen inside the
block or by the #> or #< call.
Fixes [Bug #17739]
|
|
|
|
|
| |
`[0, 1, 2, 3].max(6)` actually returns `[3, 2, 1, 0]`, but the doc said
it returns `[3, 2, 1]`.
|
|
|
|
|
|
|
|
|
| |
Reallocating to a smaller size in the transient heap may result in no
change in the actual capacity but the capacity of the array is still
updated to the smaller value.
This commit changes `ary_heap_realloc` to return the new capacity which
can be used by the caller to correctly update the capacity.
|
|
|
| |
[Bug #17814]
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* Ensure the receiver is modifiable before shinking [Bug #17736]
* Assert the receivers are not modified
|
| |
|
| |
|
|
|
|
|
| |
This change make Array#- return a copy of the receiver when
the other array is empty.
|
| |
|
| |
|
|
|
|
|
|
| |
This reverts commit ac1a4bccbda4358436a7a907a7f09d047f562740.
See https://github.com/ruby/ruby/pull/4088
|
| |
|
|
|
|
| |
* Add What's Here to Array RDoc
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also document that both :deprecated and :experimental are supported
:category option values.
The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.
Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).
Add assert_deprecated_warn to test assertions. Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
|
|
|
|
|
| |
Passing current ec can improve performance of newobj. This patch
tries it for Array and String literals ([] and '').
|
|
|
|
|
|
|
|
|
|
|
| |
ractor_copy() used rb_ary_modify() to make sure this array is not
sharing anything, but it also checks frozen flag. So frozen arrays
raises an error. To solve this issue, this patch introduces new
function rb_ary_cancel_sharing() which makes sure the array does not
share another array and it doesn't check frozen flag.
[Bug #17343]
A test is quoted from https://github.com/ruby/ruby/pull/3817
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the following methods to return Array instances instead
of subclass instances:
* Array#drop
* Array#drop_while
* Array#flatten
* Array#slice!
* Array#slice/#[]
* Array#take
* Array#take_while
* Array#uniq
* Array#*
Fixes [Bug #6087]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Support ArithmeticSequence in Array#slice
* Extract rb_range_component_beg_len
* Use rb_range_values to check Range object
* Fix ary_make_partial_step
* Fix for negative step cases
* range.c: Describe the role of err argument in rb_range_component_beg_len
* Raise a RangeError when an arithmetic sequence refers the outside of an array
[Feature #16812]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
any?
all?
one?
none?
sum
shuffle!
shuffle
sample
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
count
flatten!
flatten
cycle
permutation
combination
repeated_permutation
repeated_combination
product
take
take_while
drop
drop_while
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
&
intersection
|
union
max
min
minmax
uniq!
uniq
compact!
compact
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
+
concat
*
assoc
rassoc
==
eql?
hash
include?
<=>
-
difference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
delete_at
slice!
reject!
reject
delete_if
zip
transpose
replace
clear
fill
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
bsearch
bsearch_index
sort_by!
collect
collect!
values_at
select
select!
keep_if
delete
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
length
empty?
join
inspect
to_a
to_h
to_ary
reverse!
reverse
rotate!
rotate
sort!
sort
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
at
first
last
fetch
index
rindex
[]
insert
each
each_index
reverse_each
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
- freeze
- try_convert
- new
- \<<
- push
- pop
- shift
- unshift
- []
|
|
|
| |
Further compliance with https://github.com/ruby/ruby/blob/master/doc/method_documentation.rdoc#details-and-examples-
|
|
|
| |
"Trivial" typically means "returns a new empty Array."
|
| |
|
|
|
| |
Removes references to *-convertible thingies.
|
|
|
|
|
|
| |
RARRAY_AREF has been a macro for reasons. We might not be able to
change that for public APIs, but why not relax the situation internally
to make it an inline function.
|
|
|
|
|
| |
* Fix links to Dig Methods document
* Fix links to Dig Methods document
|