зеркало из https://github.com/github/ruby.git
Remove unused variable in array.c
vshared is no longer used.
This commit is contained in:
Родитель
fd0902bfcd
Коммит
a1c0aa7701
23
array.c
23
array.c
|
@ -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_SET_SHARED(ary);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче