diff options
Diffstat (limited to 'src/integral_base.c')
-rw-r--r-- | src/integral_base.c | 12 |
1 files changed, 2 insertions, 10 deletions
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); |