From 7b993b35b9dbf3722692d713bf846d59ff838183 Mon Sep 17 00:00:00 2001 From: Gabriel Wicki Date: Tue, 10 May 2022 22:17:20 +0200 Subject: [PATCH] core: Remove code duplication. * src/gc.c (copy_news): Remove copy of copy_cell. (gc_copy): Use copy_cell instead. --- src/gc.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/gc.c b/src/gc.c index 4a1df7cb..e0b16aa0 100644 --- a/src/gc.c +++ b/src/gc.c @@ -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; } }