From d6528d631959c88db6062a39e201a0f3e89e691f Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 8 Apr 2026 20:21:10 +0200 Subject: compile.c: avoid needless rehash These were introduced in 165e10b6cf73f723c2f6af676b70aeb2d8cf85c9 when these hashes were allocated with `rb_hash_new()`. But since 4fb1438b9d7f617c7a8dc37935a960a24219e697 they are allocated with the right size, making the rehashing pure waste. --- compile.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/compile.c b/compile.c index 5decd5e59e..d39438c8ba 100644 --- a/compile.c +++ b/compile.c @@ -2731,7 +2731,6 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor) data.len = len; rb_hash_foreach(map, cdhash_set_label_i, (VALUE)&data); - rb_hash_rehash(map); freeze_hide_obj(map); rb_ractor_make_shareable(map); generated_iseq[code_index + 1 + j] = map; @@ -14346,7 +14345,6 @@ ibf_load_object_hash(const struct ibf_load *load, const struct ibf_object_header VALUE val = ibf_load_object(load, val_index); rb_hash_aset(obj, key, val); } - rb_hash_rehash(obj); if (header->internal) rb_obj_hide(obj); if (header->frozen) { -- cgit v1.2.3