A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use xbt_XXX_is_empty() instead of testing xbt_XXX_length() against 0.
[simgrid.git]
/
examples
/
simdag
/
goal
/
goal_test.c
diff --git
a/examples/simdag/goal/goal_test.c
b/examples/simdag/goal/goal_test.c
index
838082f
..
2f8b28f
100644
(file)
--- a/
examples/simdag/goal/goal_test.c
+++ b/
examples/simdag/goal/goal_test.c
@@
-33,7
+33,7
@@
static void send_one(int from, int to) {
count++;
bcast_task_t bt;
count++;
bcast_task_t bt;
- if (
xbt_dynar_length(reclaimed)>0
) {
+ if (
!xbt_dynar_is_empty(reclaimed)
) {
bt = xbt_dynar_pop_as(reclaimed,bcast_task_t);
} else {
bt = xbt_new(s_bcast_task_t,1);
bt = xbt_dynar_pop_as(reclaimed,bcast_task_t);
} else {
bt = xbt_new(s_bcast_task_t,1);
@@
-66,7
+66,7
@@
int main(int argc, char **argv) {
xbt_dynar_t done = NULL;
send_one(0,SD_workstation_get_number());
do {
xbt_dynar_t done = NULL;
send_one(0,SD_workstation_get_number());
do {
- if (done != NULL &&
xbt_dynar_length(done) > 0
) {
+ if (done != NULL &&
!xbt_dynar_is_empty(done)
) {
unsigned int cursor;
SD_task_t task;
unsigned int cursor;
SD_task_t task;
@@
-88,7
+88,7
@@
int main(int argc, char **argv) {
xbt_dynar_free(&done);
}
done=SD_simulate(-1);
xbt_dynar_free(&done);
}
done=SD_simulate(-1);
- } while(
xbt_dynar_length(done) > 0
);
+ } while(
!xbt_dynar_is_empty(done)
);
xbt_dynar_free(&done);
xbt_dynar_free(&reclaimed);
xbt_dynar_free(&done);
xbt_dynar_free(&reclaimed);