|author||Aaron Patterson <email@example.com>||2021-10-16 11:20:30 -0700|
|committer||Nobuyoshi Nakada <firstname.lastname@example.org>||2021-10-18 17:41:38 +0900|
The `newhash` instruction was checking if `num` is greater than 0, but so is [`rb_hash_new_with_size`](https://github.com/ruby/ruby/blob/82e2443d8b1e3edd2607c78dddf5aac79a13492d/hash.c#L1564) as well as [`rb_hash_bulk_insert`](https://github.com/ruby/ruby/blob/82e2443d8b1e3edd2607c78dddf5aac79a13492d/hash.c#L4764). If we know the size is 0 in the instruction, we can just directly call `rb_hash_new` and only check the size once. Unfortunately, when num is greater than 0, it's still checked 3 times.
Notes: Merged: https://github.com/ruby/ruby/pull/4977
Diffstat (limited to 'lib/thread.rb')
0 files changed, 0 insertions, 0 deletions