Merge pull request #6576 from dearblue/ary_replace

Share array entities if possible with `ary.replace(frozen_ary)`
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-05-08 11:09:50 +09:00
committed by GitHub
+1 -1
View File
@@ -616,7 +616,7 @@ ary_replace(mrb_state *mrb, struct RArray *a, struct RArray *b)
mrb_write_barrier(mrb, (struct RBasic*)a);
return;
}
if (!mrb_frozen_p(b) && len > ARY_REPLACE_SHARED_MIN) {
if (len > ARY_REPLACE_SHARED_MIN) {
ary_make_shared(mrb, b);
goto shared_b;
}