Skip to content

Commit

Permalink
Simplify child node verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Vianpyro committed Sep 11, 2024
1 parent 7120670 commit 9f1c4ab
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions node.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ Node **generate_children(const Node *parent, int *num_children) {

for (int i = 0; i < DIRECTION_COUNT; i++) {
Node *child = generate_child_node(parent, directions[i]);
if (child != NULL) {
children[(*num_children)++] = child;
}
if (child) children[(*num_children)++] = child;
}

return children;
Expand Down

0 comments on commit 9f1c4ab

Please sign in to comment.