From: abn Date: Tue, 15 Sep 2015 07:34:00 +0000 (+0200) Subject: Using std::vector instead of new bool[] X-Git-Tag: V7_7_0b1~2^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=545868b94c2ec3d92fc2d328857f3b6e98342e03;p=modules%2Fmed.git Using std::vector instead of new bool[] --- diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 887ea5eca..96d4b34ea 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -2490,17 +2490,16 @@ void MEDCouplingUMesh::findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1On MEDCouplingAutoRefCountObjectPtr neigh00(tmp0); MEDCouplingAutoRefCountObjectPtr neighI00(tmp1); - // For each initial connex part of the sub-mesh (or said differently for each independent crack): int seed = 0, nIter = 0; int nIterMax = nCells2+1; // Safety net for the loop - bool * hitCells = new bool[nCells2]; - for (int iii=0; iii hitCells(nCells2); + hitCells.assign(nCells2, false); MEDCouplingAutoRefCountObjectPtr cellsToModifyConn0_torenum = DataArrayInt::New(); cellsToModifyConn0_torenum->alloc(0,1); while (nIter < nIterMax) { - if (std::find(hitCells, hitCells+nCells2, false) == hitCells+nCells2) + if (std::find(hitCells.begin(), hitCells.end(), false) == hitCells.end()) break; // Connex zone without the crack (to compute the next seed really) int dnu; @@ -2516,7 +2515,6 @@ void MEDCouplingUMesh::findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1On seed = comple->getIJ(0,0); nIter++; } - delete[] hitCells; if (nIter >= nIterMax) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findNodesToDuplicate(): internal error - too many iterations.");