Skip to content

Commit 5475fe3

Browse files
committed
Add early-exit optimization for LeafNode::resetBackground()
Signed-off-by: Neil Bickford <nbickford@nvidia.com>
1 parent 6b2d0e3 commit 5475fe3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

openvdb/openvdb/tree/LeafNode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,7 @@ LeafNode<T, Log2Dim>::resetBackground(const ValueType& oldBackground,
16101610
const ValueType& newBackground)
16111611
{
16121612
if (!this->allocate()) return;
1613+
if (oldBackground == newBackground || math::negative(oldBackground) == newBackground) return;
16131614

16141615
typename NodeMaskType::OffIterator iter;
16151616
// For all inactive values...

0 commit comments

Comments
 (0)