Skip to content

Commit

Permalink
Rewrite inner loop in bottom up traversal to resolve warning
Browse files Browse the repository at this point in the history
  • Loading branch information
madmann91 committed May 20, 2024
1 parent f2f8918 commit fb64590
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/bvh/v2/bvh.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,12 @@ void Bvh<Node>::traverse_bottom_up(LeafFn&& leaf_fn, InnerFn&& inner_fn) {
continue;
leaf_fn(nodes[i]);
seen[i] = true;
size_t j = parents[i];
while (j >= 0) {
for (size_t j = parents[i];; j = parents[j]) {
auto& node = nodes[j];
if (seen[j] || !seen[node.index.first_id()] || !seen[node.index.first_id() + 1])
break;
inner_fn(nodes[j]);
seen[j] = true;
j = parents[j];
}
}
}
Expand Down

0 comments on commit fb64590

Please sign in to comment.