core: Remove code duplication.

* src/gc.c (copy_news): Remove copy of copy_cell.
(gc_copy): Use copy_cell instead.
This commit is contained in:
Gabriel Wicki 2022-05-10 22:17:20 +02:00 committed by Jan (janneke) Nieuwenhuizen
parent c7777121e8
commit 7b993b35b9
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -212,14 +212,6 @@ copy_cell (struct scm *to, struct scm *from)
to->cdr = from->cdr;
}
void
copy_news (struct scm *to, struct scm *from)
{
to->type = from->type;
to->car = from->car;
to->cdr = from->cdr;
}
void
copy_stack (long index, struct scm *from)
{
@ -483,14 +475,14 @@ gc_copy (struct scm *old) /*:((internal)) */
return old->car;
struct scm *new = g_free;
g_free = g_free + M2_CELL_SIZE;
copy_news (new, old);
copy_cell (new, old);
if (new->type == TSTRUCT || new->type == TVECTOR)
{
new->vector = g_free;
long i;
for (i = 0; i < old->length; i = i + 1)
{
copy_news (g_free, cell_ref (old->vector, i));
copy_cell (g_free, cell_ref (old->vector, i));
g_free = g_free + M2_CELL_SIZE;
}
}