From 5a678e38dce8594c437eeb785470af4a987e1fcc Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 26 Dec 2015 19:43:54 +0100 Subject: [PATCH] plotting/plotit.c, xtend(), #7/7 reorder --- src/frontend/plotting/plotit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/plotting/plotit.c b/src/frontend/plotting/plotit.c index fe36654cb..15423a214 100644 --- a/src/frontend/plotting/plotit.c +++ b/src/frontend/plotting/plotit.c @@ -94,10 +94,12 @@ xtend(struct dvec *v, int length) return; } + i = v->v_length; + if (isreal(v)) { double d = NAN; v->v_realdata = TREALLOC(double, v->v_realdata, length); - i = v->v_length; + v->v_length = length; if (i > 0) d = v->v_realdata[i - 1]; while (i < length) @@ -105,14 +107,12 @@ xtend(struct dvec *v, int length) } else { ngcomplex_t c = {NAN, NAN}; v->v_compdata = TREALLOC(ngcomplex_t, v->v_compdata, length); - i = v->v_length; + v->v_length = length; if (i > 0) c = v->v_compdata[i - 1]; while (i < length) v->v_compdata[i++] = c; } - - v->v_length = length; }