diff --git a/src/BVH/BVH_Box.hxx b/src/BVH/BVH_Box.hxx index 6d2d01b0c8..be2af6c330 100644 --- a/src/BVH/BVH_Box.hxx +++ b/src/BVH/BVH_Box.hxx @@ -64,19 +64,18 @@ public: //! given transformation to this box. BVH_Box Transformed (const NCollection_Mat4& theTransform) const { - BVH_Box aResultBox; - + const BVH_Box *aThis = static_cast*>(this); if (theTransform.IsIdentity()) { - return aResultBox; + return *aThis; } - const BVH_Box *aThis = static_cast*>(this); if (!aThis->IsValid()) { - return aResultBox; + return *aThis; } + BVH_Box aResultBox; for (size_t aX = 0; aX <= 1; ++aX) { for (size_t aY = 0; aY <= 1; ++aY)