| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
* Especially around Enumerator.
|
|
|
|
| |
* See https://bugs.ruby-lang.org/issues/19078#note-30
|
|
|
|
| |
The use of keyword arguments should be reserved for future extension.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix Array#[] with ArithmeticSequence with negative steps
Previously, Array#[] when called with an ArithmeticSequence
with a negative step did not handle all cases correctly,
especially cases involving infinite ranges, inverted ranges,
and/or exclusive ends.
Fixes [Bug #18247]
* Add Array#slice tests for ArithmeticSequence with negative step to test_array
Add tests of rb_arithmetic_sequence_beg_len_step C-API function.
* Fix ext/-test-/arith_seq/beg_len_step/depend
* Rename local variables
* Fix a variable name
Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com>
|
| |
|
| |
|
|
|
|
| |
[Misc #18891]
|
|
|
|
|
| |
Runtime assertion for the argument declared as non-null.
This macro does nothing if `RBIMPL_ATTR_NONNULL` is effective,
otherwise asserts that the argument is non-null.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* --braces-after-func-def-line
* --dont-cuddle-else
* --procnames-start-lines
* --space-after-for
* --space-after-if
* --space-after-while
|
|
|
|
| |
Fixes [Bug #17889]
|
|
|
|
|
|
|
| |
If a block is given, it returns a lazy enumerator that will iterate
over the block, it doesn't iterate over the block immediately.
Fixes [Bug #17789]
|
|
|
|
|
| |
Previously these methods were defined but raised TypeError, which
seems worse.
|
|
|
|
| |
Implements [Feature #17347]
|
|
|
|
|
|
|
| |
This previously raised a TypeError. Wrap the Enumerator::Chain in
an Enumerator to work around the problem.
Fixes [Bug #17216]
|
|
|
|
| |
Because `Kernel.#open` no longer opens URI since Ruby 3.0.
|
| |
|
|
|
|
|
| |
Has been deprecated since c73b6bd7ebd01133538c645566944132dbde4d13.
[Feature #17116] [ruby-dev:50945]
|
| |
|
|
|
|
|
|
| |
sequences (#3870)
[Bug #17218]
[ruby-core:100312]
|
|
|
|
|
|
|
|
|
|
| |
```
find . -name \*.o -exec nm {} + |&
grep -e 'InitVM_.*\.rbimpl_id' -e 'Init_.*\.rbimpl_id' |
sed 's/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' |
uniq
```
should be empty.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
| |compare-ruby|built-ruby|
|:-------------------|-----------:|---------:|
|first_ary | 290.514k| 296.331k|
| | -| 1.02x|
|first_nonary | 166.954k| 169.178k|
| | -| 1.01x|
|first_noarg | 299.547k| 305.358k|
| | -| 1.02x|
|take3_ary | 129.388k| 188.360k|
| | -| 1.46x|
|take3_nonary | 90.684k| 112.688k|
| | -| 1.24x|
|take3_noarg | 131.940k| 189.471k|
| | -| 1.44x|
|chain-first_ary | 195.913k| 286.194k|
| | -| 1.46x|
|chain-first_nonary | 127.483k| 168.716k|
| | -| 1.32x|
|chain-first_noarg | 201.252k| 298.562k|
| | -| 1.48x|
|chain-take3_ary | 101.189k| 183.188k|
| | -| 1.81x|
|chain-take3_nonary | 75.381k| 112.301k|
| | -| 1.49x|
|chain-take3_noarg | 101.483k| 192.148k|
| | -| 1.89x|
|block | 296.696k| 292.877k|
| | 1.01x| -|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
| |compare-ruby|built-ruby|
|:-------|-----------:|---------:|
|num3 | 96.333k| 160.732k|
| | -| 1.67x|
|num10 | 96.615k| 159.150k|
| | -| 1.65x|
|ary2 | 103.836k| 172.787k|
| | -| 1.66x|
|ary10 | 109.249k| 177.252k|
| | -| 1.62x|
|ary20 | 106.628k| 177.371k|
| | -| 1.66x|
|ary50 | 107.135k| 162.282k|
| | -| 1.51x|
|ary100 | 106.513k| 177.626k|
| | -| 1.67x|
|
| |
|
| |
|
| |
|
|
|
|
| |
To fix build failures.
|
|
|
|
| |
This shall fix compile errors.
|
| |
|
|
|
|
| |
[DOC] [#16829]
|
|
|
|
|
|
| |
This is my first attempt at a pull request. I was reading the ruby docs
the other day and noticed that the output didn't match the code sample
on the with_object documentation. Inserted spaces to fix it.
|
| |
|
|
|
| |
Split ruby.h
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the warnings added in 2.7, and changes the behavior
so that a final positional hash is not treated as keywords or
vice-versa.
To handle the arg_setup_block splat case correctly with keyword
arguments, we need to check if we are taking a keyword hash.
That case didn't have a test, but it affects real-world code,
so add a test for it.
This removes rb_empty_keyword_given_p() and related code, as
that is not needed in Ruby 3. The empty keyword case is the
same as the no keyword case in Ruby 3.
This changes rb_scan_args to implement keyword argument
separation for C functions when the : character is used.
For backwards compatibility, it returns a duped hash.
This is a bad idea for performance, but not duping the hash
breaks at least Enumerator::ArithmeticSequence#inspect.
Instead of having RB_PASS_CALLED_KEYWORDS be a number,
simplify the code by just making it be rb_keyword_given_p().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead. This would significantly
speed up incremental builds.
We take the following inclusion order in this changeset:
1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very
first thing among everything).
2. RUBY_EXTCONF_H if any.
3. Standard C headers, sorted alphabetically.
4. Other system headers, maybe guarded by #ifdef
5. Everything else, sorted alphabetically.
Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
|
| |
|
|
|
|
|
|
| |
In #2612 I made two typos (extra ,, and copy-pasted
same line of code instead of showing two different
ones), fixing them.
|
|
|
|
|
|
| |
* fix list in #flat_map
* fix wrong indentation in #filter_map and #with_index
* other small fixes
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make it correctly handle lambdas
* Make it iterate over the block if block is given
The original implementation was flawed, based on lazy_set_method
instead of lazy_add_method.
Note that there is no implicit map when passing a block, the return
value of the block passed to with_index is ignored, just as it
is for Enumerator#with_index. Also like Enumerator#with_index,
when called with a block, the return value is an enumerator without
the index.
Fixes [Bug #16414]
|