| Age | Commit message (Collapse) | Author |
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13265
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12984
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/10924
|
|
[Feature #19236]
When building a large hash, pre-allocating it with enough
capacity can save many re-hashes and significantly improve
performance.
```
/opt/rubies/3.3.0/bin/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \
--executables="compare-ruby::../miniruby-master -I.ext/common --disable-gem" \
--executables="built-ruby::./miniruby --disable-gem" \
--output=markdown --output-compare -v $(find ./benchmark -maxdepth 1 -name 'hash_new' -o -name '*hash_new*.yml' -o -name '*hash_new*.rb' | sort)
compare-ruby: ruby 3.4.0dev (2024-03-25T11:48:11Z master f53209f023) +YJIT dev [arm64-darwin23]
last_commit=[ruby/irb] Cache RDoc::RI::Driver.new (https://github.com/ruby/irb/pull/911)
built-ruby: ruby 3.4.0dev (2024-03-25T15:29:40Z hash-new-rb 77652b08a2) +YJIT dev [arm64-darwin23]
warming up...
| |compare-ruby|built-ruby|
|:-------------------|-----------:|---------:|
|new | 7.614M| 5.976M|
| | 1.27x| -|
|new_with_capa_1k | 13.931k| 15.698k|
| | -| 1.13x|
|new_with_capa_100k | 124.746| 148.283|
| | -| 1.19x|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Feature #19236]
In Ruby 3.3, `Hash.new` shall print a deprecation warning if keyword arguments
are passed instead of treating them as an implicit positional Hash.
This will allow to safely introduce a `capacity` keyword argument in 3.4
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
Notes:
Merged-By: byroot <byroot@ruby-lang.org>
|
|
|
|
The documentation states it returns a copy of self with nil value
entries removed. However, the previous behavior was creating a
plain new hash with non-nil values copied into it. This change
aligns the behavior with the documentation.
Fixes [Bug #19113]
Notes:
Merged: https://github.com/ruby/ruby/pull/6702
|
|
This was already copied for non-empty hashes. As Hash.ruby2_keywords_hash
copies default values, it should also copy the compare_by_identity flag.
Partially Fixes [Bug #19113]
Notes:
Merged: https://github.com/ruby/ruby/pull/6702
|
|
It wasn't copied for empty hashes, and Hash.[] doesn't copy the
default value, so copying the compare_by_identity flag does not
make sense.
Partially Fixes [Bug #19113]
Notes:
Merged: https://github.com/ruby/ruby/pull/6702
|
|
|
|
|
|
|
|
|
|
Fixes [Bug #16908]
Notes:
Merged: https://github.com/ruby/ruby/pull/5360
|
|
|
|
|
|
|
|
|
|
https://github.com/ruby/spec/pull/833
https://github.com/ruby/spec/commit/8290e5ad8952b14ee9a5069651d9864c66681112
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4294
Merged-By: nobu <nobu@ruby-lang.org>
|
|
iff means if and only if, but readers without that knowledge might
assume this to be a spelling mistake. To me, this seems like
exclusionary language that is unnecessary. Simply using "if and only if"
instead should suffice.
Notes:
Merged: https://github.com/ruby/ruby/pull/4035
|
|
|
|
|
|
[Feature #15822]
Notes:
Merged: https://github.com/ruby/ruby/pull/3929
|
|
|
|
Has been deprecated since 0c97c8e33584e6203bb09c08f92b63bd2cca8ae7.
|
|
|
|
|
|
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3370
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2892
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2892
|
|
Like `Symbol#to_proc` (f0b815dc670b61eba1daaa67a8613ac431d32b16)
|
|
As a semantics, Hash#each yields a 2-element array (pairs of keys and
values). So, `{ a: 1 }.each(&->(k, v) { })` should raise an exception
due to lambda's arity check.
However, the optimization that avoids Array allocation by using
rb_yield_values for blocks whose arity is more than 1 (introduced at
b9d29603375d17c3d1d609d9662f50beaec61fa1 and some commits), seemed to
overlook the lambda case, and wrongly allowed the code above to work.
This change experimentally attempts to make it strict; now the code
above raises an ArgumentError. This is an incompatible change; if the
compatibility issue is bigger than our expectation, it may be reverted
(until Ruby 3.0 release).
[Bug #12706]
|
|
|
|
This removes the related tests, and puts the related specs behind
version guards. This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
Notes:
Merged: https://github.com/ruby/ruby/pull/2476
|
|
|
|
|
|
|