aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@d60812e6-3970-4df4-986e-c251b06effeb>2012-11-22 03:47:48 +0000
committereschnett <eschnett@d60812e6-3970-4df4-986e-c251b06effeb>2012-11-22 03:47:48 +0000
commitd41baa4c819a5f3c51d03ce7372286589bce563c (patch)
tree143b9d0aba6aa1fbcafdbd667c57b29cfbdaeb29
parent82bb7832c7904a41b7bfb4d1339650890f273b7a (diff)
Remove superfluous if condition
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@104 d60812e6-3970-4df4-986e-c251b06effeb
-rw-r--r--src/ReduceArraysGlobally.c26
-rw-r--r--src/ReduceGA.c30
2 files changed, 22 insertions, 34 deletions
diff --git a/src/ReduceArraysGlobally.c b/src/ReduceArraysGlobally.c
index 47f1659..9f0e6e4 100644
--- a/src/ReduceArraysGlobally.c
+++ b/src/ReduceArraysGlobally.c
@@ -218,14 +218,11 @@ static int ReduceArraysGlobally (const cGH *GH,
dim = input_dims;
/* allocate memory for the array of the dimensions of the input arrays */
- if (dim>0)
- {
- lower_array_bounds = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- min_array_subscript = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- array_lsh = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- input_array_dims = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- input_array_gz = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- }
+ lower_array_bounds = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
+ min_array_subscript = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
+ array_lsh = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
+ input_array_dims = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
+ input_array_gz = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
/* calculate index ranges */
for ( i=0; i < dim; i++)
@@ -772,14 +769,11 @@ static int ReduceArraysGlobally (const cGH *GH,
num_points = total_num_points;
weight_sum = total_weight_sum;
#endif
- if (dim >0)
- {
- free (lower_array_bounds);
- free (min_array_subscript);
- free (array_lsh);
- free (input_array_dims);
- free (input_array_gz);
- }
+ free (lower_array_bounds);
+ free (min_array_subscript);
+ free (array_lsh);
+ free (input_array_dims);
+ free (input_array_gz);
if (perform_division == 0)
{
diff --git a/src/ReduceGA.c b/src/ReduceGA.c
index 98b2890..72c74f3 100644
--- a/src/ReduceGA.c
+++ b/src/ReduceGA.c
@@ -205,14 +205,11 @@ static int ReduceGridArrays (const cGH *GH,
dim = CCTK_GroupDimFromVarI(input_array_variable_indices[0]);
/* allocate memory for the array of the dimensions of the input arrays */
- if (dim >0)
- {
- lower_array_bounds = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- min_array_subscript = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- array_lsh = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- input_array_dims = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- input_array_gz = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
- }
+ lower_array_bounds = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
+ min_array_subscript = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
+ array_lsh = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
+ input_array_dims = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
+ input_array_gz = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT));
/* find out the types of the input arrays and put that */
/* in an array ipughGH->GFExtras[dim]->lnsize[i]*/
@@ -773,17 +770,14 @@ static int ReduceGridArrays (const cGH *GH,
}
free (local_outvals);
}
- num_points = total_num_points;
- weight_sum = total_weight_sum;
+ num_points = total_num_points;
+ weight_sum = total_weight_sum;
#endif
- if (dim >0)
- {
- free (lower_array_bounds);
- free (min_array_subscript);
- free (array_lsh);
- free (input_array_dims);
- free (input_array_gz);
- }
+ free (lower_array_bounds);
+ free (min_array_subscript);
+ free (array_lsh);
+ free (input_array_dims);
+ free (input_array_gz);
if (perform_division == 0)
{