From 9c0075ed0c0572d8038f228566c860adac5eacd3 Mon Sep 17 00:00:00 2001 From: Todd Fincannon Date: Thu, 18 Nov 2021 19:01:49 -0800 Subject: [PATCH] remove unnecessary lookup data memcpy loop --- src/c/vensim.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/c/vensim.c b/src/c/vensim.c index 30f8f313..98478e65 100644 --- a/src/c/vensim.c +++ b/src/c/vensim.c @@ -62,9 +62,7 @@ Lookup* __new_lookup(size_t size, bool copy, double* data) { if (copy) { // Copy array into the lookup data. lookup->data = malloc(sizeof(double) * 2 * size); - for (size_t i = 0; i < 2 * size; i++) { - memcpy(lookup->data, data, size * 2 * sizeof(double)); - } + memcpy(lookup->data, data, size * 2 * sizeof(double)); } else { // Store a pointer to the lookup data (assumed to be static or owned elsewhere). lookup->data = data;