mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #6576 from dearblue/ary_replace
Share array entities if possible with `ary.replace(frozen_ary)`
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user