hash.c (mrb_hash_compact): call hash_modify instead of mrb_check_frozen

Currently, hash_modify() only calls mrb_check_frozen, but we may add new
checks in the future; ref #6485
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-03-08 11:15:37 +09:00
parent 96113a2ed9
commit 213a262b20
+1 -1
View File
@@ -1828,7 +1828,7 @@ mrb_hash_compact(mrb_state *mrb, mrb_value hash)
uint32_t size = ht_p ? ht_size(h) : ar_size(h);
uint32_t dec = 0;
mrb_check_frozen(mrb, h);
hash_modify(mrb, hash);
H_EACH(h, entry) {
if (mrb_nil_p(entry->val)) {
entry_delete(entry);