From 46cae873fa2bd7973aa2e98d5955d2287822c604 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Fri, 20 May 2016 21:41:54 +0000 Subject: Array: add array_alloc_tmps_* --- src/integral_base.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/integral_base.c') diff --git a/src/integral_base.c b/src/integral_base.c index da3f05a..e743191 100644 --- a/src/integral_base.c +++ b/src/integral_base.c @@ -254,16 +254,8 @@ int INTEGRAL_FUNC(integrate_gauss_smarttmp) (INTEGRAL_FLOAT_TYPE* out, int (*fun return(LIBINUM_ERROR_SIZE_MISMATCH); } - // allocate tmps if needed - if(tmps->memory<4){ - // no need to resize since the values should not be kept - INTEGRAL_FLOATARRAY_FUNC(free)(*tmps); - INTEGRAL_FLOATARRAY_FUNC(init)(tmps, 4); - } - for (i=tmps->length;i<4;i++){ - INTEGRAL_FLOAT_INIT(tmps->values[i]); - (tmps->length)++; - } + // allocate tmp values if needed + INTEGRAL_FLOATARRAY_FUNC(alloc_tmps)(4, tmps); // init to 0 INTEGRAL_FLOAT_SET_UI(*out, 0); -- cgit v1.2.3-54-g00ecf