Skip to content

Commit

Permalink
Get rid of the extra variable when running spatial predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed May 9, 2023
1 parent 92d0058 commit 72da1f2
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/details/ArborX_DetailsTreeTraversal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,9 @@ struct TreeTraversal<BVH, Predicates, Callback, SpatialPredicateTag>
{
auto const &predicate = Access::get(_predicates, queryIndex);

int node;
int next = HappyTreeFriends::getRoot(_bvh); // start with root
int node = HappyTreeFriends::getRoot(_bvh); // start with root
do
{
node = next;

auto const leaf_node = HappyTreeFriends::leafIndex(_bvh, node);
bool const is_leaf = HappyTreeFriends::isLeaf(_bvh, node);

Expand Down Expand Up @@ -129,20 +126,20 @@ struct TreeTraversal<BVH, Predicates, Callback, SpatialPredicateTag>
_callback, predicate,
HappyTreeFriends::getLeafPermutationIndex(_bvh, leaf_node)))
return;
next = HappyTreeFriends::getRope(LeafNodeTag{}, _bvh, leaf_node);
node = HappyTreeFriends::getRope(LeafNodeTag{}, _bvh, leaf_node);
}
else
{
next = HappyTreeFriends::getLeftChild(_bvh, node);
node = HappyTreeFriends::getLeftChild(_bvh, node);
}
}
else
{
next = (is_leaf
node = (is_leaf
? HappyTreeFriends::getRope(LeafNodeTag{}, _bvh, leaf_node)
: HappyTreeFriends::getRope(InternalNodeTag{}, _bvh, node));
}
} while (next != ROPE_SENTINEL);
} while (node != ROPE_SENTINEL);
}
};

Expand Down

0 comments on commit 72da1f2

Please # to comment.