From 1b3763f4c14e46f7f182710c6e47061edf5a7c26 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 24 Jun 2021 12:21:06 +0200 Subject: [PATCH] isl_multi_*_apply_aligned_*: use isl_multi_*_size This reduces the dependence on the internal representation. Signed-off-by: Sven Verdoolaege --- isl_multi_apply_templ.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/isl_multi_apply_templ.c b/isl_multi_apply_templ.c index 870f2676..d8e3b038 100644 --- a/isl_multi_apply_templ.c +++ b/isl_multi_apply_templ.c @@ -19,12 +19,14 @@ __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)( __isl_take MULTI(BASE) *multi, __isl_take APPLY_DOM *set, __isl_give EL *(*fn)(EL *el, __isl_take APPLY_DOM *set)) { + isl_size n; int i; - if (!multi || !set) + n = FN(MULTI(BASE),size)(multi); + if (n < 0 || !set) goto error; - if (multi->n == 0) { + if (n == 0) { FN(APPLY_DOM,free)(set); return multi; } @@ -33,7 +35,7 @@ __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)( if (!multi) goto error; - for (i = 0; i < multi->n; ++i) { + for (i = 0; i < n; ++i) { multi->u.p[i] = fn(multi->u.p[i], FN(APPLY_DOM,copy)(set)); if (!multi->u.p[i]) goto error; -- 2.11.4.GIT