```
../string.c:660:38: warning: comparison of integers of different signs: 'rb_atomic_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
660 | RUBY_ASSERT(table->count < table->capacity / 2);
```
Highlight the performance advantages of calling `string.split` with a block, instead of `string.split.each` with the same block.
Includes other minor formatting corrections.
`objspace->finalizer_table` must be synchronized,
otherwise concurrent insertion from multiple ractors
will cause a crash.
Repro:
```ruby
ractors = 5.times.map do |i|
Ractor.new do
100_000.times.map do
o = Object.new
ObjectSpace.define_finalizer(o, ->(id) {})
o
end
end
end
ractors.each(&:take)
```
The array allocation was because the keyword splat expression is
not recognized as safe by the compiler. Also avoid unnecessary
>= method call per element. This uses a private constant to
avoid unnecessary work at runtime.
I assume the only reason this code is needed is because v may
end with a ruby2_keywords hash that we do not want to treat as
keywords.
This issue was found by the performance warning in Ruby feature
21274.
https://github.com/ruby/pp/commit/3bf6df0e5c
Rubygems sets the date of built gems to `DEFAULT_SOURCE_DATE_EPOCH`
now unless `SOURCE_DATE_EPOCH` environment variable is set. It is
just for the reproducible build, meaningless in our ChangeLog.
Also, rename `format_changelog` to `changelog_formatter` since this
method does not format the changelog when called, but rather returns a
Proc that takes IO and writes the formatted changelog.
Because get_push_scope is a method call, Ruby will allocate an array
for *args even though it is not necessary to do so. Using a local
variable avoids the allocation.
Found by the performance warning in Ruby feature 21274.
https://github.com/rubygems/rubygems/commit/0473c0cf32
- The command can either be run using:
1. `bundle doctor --ssl`
2. `bundle doctor ssl`
The later is most useful when you need to specify
custom ssl options (such as the verify mode or the
TLS version when running the diagnostic).
The implementation will follow in the next commits.
https://github.com/rubygems/rubygems/commit/993d12874c
- Adding a new `ssl` option to bundle doctor will make the `Doctor`
command quite bloated. The "diagnose ssl" option will also have
children option to allow passing which host or which tls version
you want to diagnose and I feel these options don't belong in the
doctor command.
So my intention in this commit is to prepare to have a new `Doctor`
subcommand and allow for better organisation of the code:
The command will be:
`bundle doctor` -> Run exactly the same as before.
`bundle doctor --ssl` -> Run the doctor command and diagnose SSL
with default options (rubygems.org as the host and verify peer as
the verify mode)
`bundle doctor ssl --host github.com` -> Run the ssl subcommand and
pass a specific host.
This commit just renames a file in order to avoid big diff chunks.