From 7c6fc1343b717a2df8241b66c01d8dd68333babb Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 26 Dec 2015 19:44:33 +0100 Subject: [PATCH] plotting/plotit.c, xtend(), #3/7 complex assignment --- src/frontend/plotting/plotit.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/frontend/plotting/plotit.c b/src/frontend/plotting/plotit.c index d455bb2a3..06e588a1d 100644 --- a/src/frontend/plotting/plotit.c +++ b/src/frontend/plotting/plotit.c @@ -109,16 +109,12 @@ xtend(struct dvec *v, int length) oc = v->v_compdata; v->v_compdata = TMALLOC(ngcomplex_t, length); for (i = 0; i < v->v_length; i++) { - realpart(v->v_compdata[i]) = realpart(oc[i]); - imagpart(v->v_compdata[i]) = imagpart(oc[i]); + v->v_compdata[i] = oc[i]; } - realpart(c) = realpart(oc[i - 1]); - imagpart(c) = imagpart(oc[i - 1]); + c = oc[i - 1]; tfree(oc); - while (i < length) { - realpart(v->v_compdata[i]) = realpart(c); - imagpart(v->v_compdata[i++]) = imagpart(c); - } + while (i < length) + v->v_compdata[i++] = c; } v->v_length = length;