Skip to content

Commit 68e2a6c

Browse files
authored
[algorithm] More compact syntax for shaftProx check in loop
1 parent 0fe1f15 commit 68e2a6c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/sofa/collisionAlgorithm/algorithm/InsertionAlgorithm.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,9 @@ class InsertionAlgorithm : public BaseAlgorithm
292292
{
293293
const BaseProximity::SPtr shaftProx = findClosestProxOnShaft(
294294
m_couplingPts[i], l_shaftGeom.get(), projectOnShaft, getFilterFunc());
295-
if (shaftProx)
296-
{
297-
shaftProx->normalize();
298-
insertionOutput.add(shaftProx, m_couplingPts[i]);
299-
}
295+
if (!shaftProx) continue;
296+
shaftProx->normalize();
297+
insertionOutput.add(shaftProx, m_couplingPts[i]);
300298
}
301299
}
302300

0 commit comments

Comments
 (0)