Commit 92f1e068 authored by Nicolas Denoyelle's avatar Nicolas Denoyelle

cosmetique

parent fb6a4ec2
......@@ -152,3 +152,4 @@ error:
excit_free(results[i]);
return err;
}
......@@ -31,7 +31,6 @@ static void tleaf_it_free(excit_t it)
free(data_it->order);
if (data_it->buf != NULL)
free(data_it->buf);
if (data_it->levels)
excit_free(data_it->levels);
}
......@@ -203,17 +202,14 @@ static int tleaf_it_copy(excit_t dst_it, const excit_t src_it)
}
/* dst is not initialized (anymore) */
excit_t levels = excit_alloc(EXCIT_PRODUCT);
excit_t levels = excit_dup(src->levels);
if (levels == NULL)
return -EXCIT_ENOMEM;
err = src_it->func_table->copy(levels, src->levels);
if (err != EXCIT_SUCCESS)
goto error_with_levels;
if (levels == NULL) {
err = -EXCIT_ENOMEM;
goto error;
}
err =
excit_tleaf_init_with_it(dst_it, src->depth + 1, src->arities,
err = excit_tleaf_init_with_it(dst_it, src->depth + 1, src->arities,
TLEAF_POLICY_USER, src->order, levels);
if (err != EXCIT_SUCCESS)
goto error_with_levels;
......@@ -222,6 +218,7 @@ static int tleaf_it_copy(excit_t dst_it, const excit_t src_it)
error_with_levels:
excit_free(levels);
error:
return err;
}
......
......@@ -44,7 +44,7 @@ void test_tleaf_iterator(void)
for (i = 0; i < TLEAF_NSPLIT; i++)
split[i] = excit_alloc(EXCIT_TLEAF);
err = tleaf_it_split_at_level(it, 2, TLEAF_NSPLIT, split);
err = tleaf_it_split(it, 2, TLEAF_NSPLIT, split);
assert(err == EXCIT_SUCCESS);
err = excit_rewind(split[1]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment