From 48383de86e603390f132a00ea9c4a206a50d9baa Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sun, 30 Dec 2012 00:17:04 +0000 Subject: [PATCH] [1D] Eliminated "goto" statements in MultiNewton::solve --- src/oneD/MultiNewton.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/oneD/MultiNewton.cpp b/src/oneD/MultiNewton.cpp index 0ab925641..01c835b51 100644 --- a/src/oneD/MultiNewton.cpp +++ b/src/oneD/MultiNewton.cpp @@ -478,7 +478,7 @@ int MultiNewton::solve(doublereal* x0, doublereal* x1, // convergence else if (m == 1) { - goto done; + break; } // If dampStep fails, first try a new Jacobian if an old @@ -488,19 +488,18 @@ int MultiNewton::solve(doublereal* x0, doublereal* x1, if (jac.age() > 1) { forceNewJac = true; if (nJacReeval > 3) { - goto done; + break; } nJacReeval++; if (loglevel > 0) writelog("\nRe-evaluating Jacobian, since no damping " "coefficient\ncould be found with this Jacobian.\n"); } else { - goto done; + break; } } } -done: if (m < 0) { copy(x, x + m_n, x1); }