isl_{set,map}_dup: copy subsets instead of duping them
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 12 Oct 2008 14:10:27 +0000 (16:10 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 14 Oct 2008 08:22:00 +0000 (10:22 +0200)
If the subsets are going to be changed, they will be
duped anyway later and otherwise it is a waste to dup them.

isl_map.c

index db77417..9161f53 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -1825,8 +1825,7 @@ struct isl_set *isl_set_dup(struct isl_set *set)
        if (!dup)
                return NULL;
        for (i = 0; i < set->n; ++i)
-               dup = isl_set_add(dup,
-                                 isl_basic_set_dup(set->p[i]));
+               dup = isl_set_add(dup, isl_basic_set_copy(set->p[i]));
        return dup;
 }
 
@@ -2691,8 +2690,7 @@ struct isl_map *isl_map_dup(struct isl_map *map)
        dup = isl_map_alloc(map->ctx, map->nparam, map->n_in, map->n_out, map->n,
                                map->flags);
        for (i = 0; i < map->n; ++i)
-               dup = isl_map_add(dup,
-                                 isl_basic_map_dup(map->p[i]));
+               dup = isl_map_add(dup, isl_basic_map_copy(map->p[i]));
        return dup;
 }