Assume that shared_root exists in rb_ary_decrement_share
All callers of rb_ary_decrement_share guarantee that shared_root is not 0.
This commit is contained in:
parent
7348db866a
commit
45786667ec
8
array.c
8
array.c
@ -512,11 +512,9 @@ ary_double_capa(VALUE ary, long min)
|
|||||||
static void
|
static void
|
||||||
rb_ary_decrement_share(VALUE shared_root)
|
rb_ary_decrement_share(VALUE shared_root)
|
||||||
{
|
{
|
||||||
if (shared_root) {
|
long num = ARY_SHARED_ROOT_REFCNT(shared_root) - 1;
|
||||||
long num = ARY_SHARED_ROOT_REFCNT(shared_root) - 1;
|
if (num > 0) {
|
||||||
if (num > 0) {
|
ARY_SET_SHARED_ROOT_REFCNT(shared_root, num);
|
||||||
ARY_SET_SHARED_ROOT_REFCNT(shared_root, num);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user