1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove unused variable in array.c

vshared is no longer used.
This commit is contained in:
Peter Zhu 2022-07-18 10:49:28 -04:00
parent fd0902bfcd
commit a1c0aa7701

21
array.c
View file

@ -1043,26 +1043,25 @@ ary_make_shared(VALUE ary)
long capa = ARY_CAPA(ary), len = RARRAY_LEN(ary);
const VALUE *ptr;
VALUE shared = ary_alloc_heap(0);
VALUE vshared = (VALUE)shared;
rb_ary_transient_heap_evacuate(ary, TRUE);
ptr = ARY_HEAP_PTR(ary);
FL_UNSET_EMBED(vshared);
ARY_SET_LEN(vshared, capa);
ARY_SET_PTR(vshared, ptr);
ary_mem_clear(vshared, len, capa - len);
FL_SET_SHARED_ROOT(vshared);
ARY_SET_SHARED_ROOT_REFCNT(vshared, 1);
FL_UNSET_EMBED(shared);
ARY_SET_LEN(shared, capa);
ARY_SET_PTR(shared, ptr);
ary_mem_clear(shared, len, capa - len);
FL_SET_SHARED_ROOT(shared);
ARY_SET_SHARED_ROOT_REFCNT(shared, 1);
FL_SET_SHARED(ary);
RB_DEBUG_COUNTER_INC(obj_ary_shared_create);
ARY_SET_SHARED(ary, vshared);
OBJ_FREEZE(vshared);
ARY_SET_SHARED(ary, shared);
OBJ_FREEZE(shared);
ary_verify(vshared);
ary_verify(shared);
ary_verify(ary);
return vshared;
return shared;
}
}