STYLE: use list methods find/found instead of findIndex function

This commit is contained in:
Mark Olesen
2017-10-24 19:07:34 +02:00
parent 5b8b689a37
commit 7d7b0bfe84
136 changed files with 369 additions and 441 deletions

View File

@ -306,7 +306,7 @@ int main(int argc, char *argv[])
const wordList& regions = iter();
forAll(regions, i)
{
if (findIndex(regionNames, regions[i]) == -1)
if (!regionNames.found(regions[i]))
{
regionNames.append(regions[i]);
}

View File

@ -67,11 +67,8 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
const indexedParticle& ppi = *iter();
particleIndices_[pi++] = ppi.index();
label mappedTetFace = findIndex
(
decodedProcFaceAddressing,
ppi.tetFace()
);
const label mappedTetFace =
decodedProcFaceAddressing.find(ppi.tetFace());
if (mappedTetFace == -1)
{

View File

@ -189,7 +189,7 @@ int main(int argc, char *argv[])
const wordList& regions = iter();
forAll(regions, i)
{
if (findIndex(regionNames, regions[i]) == -1)
if (!regionNames.found(regions[i]))
{
regionNames.append(regions[i]);
}

View File

@ -105,7 +105,7 @@ void Foam::parLagrangianRedistributor::findClouds
// One of the objects is coordinates/positions so must be valid
// cloud
label cloudI = findIndex(cloudNames, localCloudDirs[i]);
label cloudI = cloudNames.find(localCloudDirs[i]);
objectNames[cloudI].setSize(sprayObjs.size());
label objectI = 0;

View File

@ -857,7 +857,7 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
// processors
autoPtr<fvMeshSubset> subsetterPtr;
const bool allHaveMesh = (findIndex(haveMesh, false) == -1);
const bool allHaveMesh = !haveMesh.found(false);
if (!allHaveMesh)
{
// Find last non-processor patch.