diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index e016a5397b..1f8b436d95 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -2568,7 +2568,7 @@ Foam::pointIndexHit Foam::indexedOctree::findNearest { scalar nearestDistSqr = startDistSqr; label nearestShapeI = -1; - point nearestPoint; + point nearestPoint = vector::zero; if (nodes_.size()) { @@ -2582,10 +2582,6 @@ Foam::pointIndexHit Foam::indexedOctree::findNearest nearestPoint ); } - else - { - nearestPoint = vector::zero; - } return pointIndexHit(nearestShapeI != -1, nearestPoint, nearestShapeI); }