In the following code:
for (int i = 0;i < num_neighbors && i != msg.source && neighbors[i].status == EDGE_STATUS_BRANCH;i++) {
....
}
loop body was never entered.
Where as after making this change:
for (int i = 0;i < num_neighbors;i++)
{
if (i != msg.source && neighbors[i].status == EDGE_STATUS_BRANCH) {
...
}
}
the body inside if branch was entered.
Why is the condition in the first for loop evaluated to false but not the second one?