mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: check iterator validity with good() instead of found()
- aligns better with other container checks
This commit is contained in:
@ -86,7 +86,7 @@ Foam::label Foam::cellSplitter::newOwner
|
||||
|
||||
const auto iter = cellToCells.cfind(old);
|
||||
|
||||
if (!iter.found())
|
||||
if (!iter.good())
|
||||
{
|
||||
// Unsplit cell
|
||||
return old;
|
||||
@ -113,7 +113,7 @@ Foam::label Foam::cellSplitter::newNeighbour
|
||||
|
||||
const auto iter = cellToCells.cfind(old);
|
||||
|
||||
if (!iter.found())
|
||||
if (!iter.good())
|
||||
{
|
||||
// Unsplit cell
|
||||
return old;
|
||||
|
||||
@ -1063,7 +1063,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const auto iter = fluentToFoamType.cfind(type);
|
||||
|
||||
if (iter.found())
|
||||
if (iter.good())
|
||||
{
|
||||
// See if we have a periodic and can derive the other side.
|
||||
word neighbPatchName;
|
||||
|
||||
@ -225,7 +225,7 @@ void storeCellInZone
|
||||
{
|
||||
const auto zoneFnd = physToZone.cfind(regPhys);
|
||||
|
||||
if (zoneFnd.found())
|
||||
if (zoneFnd.good())
|
||||
{
|
||||
// Existing zone for region
|
||||
zoneCells[zoneFnd()].append(celli);
|
||||
@ -592,7 +592,7 @@ void readCellsLegacy
|
||||
const auto regFnd = physToPatch.cfind(regPhys);
|
||||
|
||||
label patchi = -1;
|
||||
if (regFnd.found())
|
||||
if (regFnd.good())
|
||||
{
|
||||
// Existing patch for region
|
||||
patchi = regFnd();
|
||||
@ -625,7 +625,7 @@ void readCellsLegacy
|
||||
const auto regFnd = physToPatch.cfind(regPhys);
|
||||
|
||||
label patchi = -1;
|
||||
if (regFnd.found())
|
||||
if (regFnd.good())
|
||||
{
|
||||
// Existing patch for region
|
||||
patchi = regFnd();
|
||||
@ -934,7 +934,7 @@ void readCells
|
||||
const auto regFnd = physToPatch.cfind(regPhys);
|
||||
|
||||
label patchi = -1;
|
||||
if (regFnd.found())
|
||||
if (regFnd.good())
|
||||
{
|
||||
// Existing patch for region
|
||||
patchi = regFnd();
|
||||
@ -972,7 +972,7 @@ void readCells
|
||||
const auto regFnd = physToPatch.cfind(regPhys);
|
||||
|
||||
label patchi = -1;
|
||||
if (regFnd.found())
|
||||
if (regFnd.good())
|
||||
{
|
||||
// Existing patch for region
|
||||
patchi = regFnd();
|
||||
|
||||
@ -222,7 +222,7 @@ int main(int argc, char *argv[])
|
||||
// (uses commutative hash)
|
||||
auto iter = vertsToBoundary.find(triFace(f[0], f[1], f[2]));
|
||||
|
||||
if (iter.found())
|
||||
if (iter.good())
|
||||
{
|
||||
const triFace& tri = iter.key();
|
||||
const label facei = iter.val();
|
||||
|
||||
@ -443,7 +443,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const auto patchFind = regionToPatch.cfind(region);
|
||||
|
||||
if (patchFind.found())
|
||||
if (patchFind.good())
|
||||
{
|
||||
patchi = *patchFind;
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ void writePoints
|
||||
|
||||
const auto e0Fnd = pointToObj.cfind(e[0]);
|
||||
|
||||
if (e0Fnd.found())
|
||||
if (e0Fnd.good())
|
||||
{
|
||||
v0 = *e0Fnd;
|
||||
}
|
||||
@ -139,7 +139,7 @@ void writePoints
|
||||
|
||||
const auto e1Fnd = pointToObj.cfind(e[1]);
|
||||
|
||||
if (e1Fnd.found())
|
||||
if (e1Fnd.good())
|
||||
{
|
||||
v1 = *e1Fnd;
|
||||
}
|
||||
|
||||
@ -416,7 +416,7 @@ void Foam::DistributedDelaunayMesh<Triangulation>::markVerticesToRefer
|
||||
const auto iter = circumsphereOverlaps.cfind(cit->cellIndex());
|
||||
|
||||
// Pre-tested circumsphere potential influence
|
||||
if (iter.found())
|
||||
if (iter.good())
|
||||
{
|
||||
const labelList& citOverlaps = iter();
|
||||
|
||||
|
||||
@ -2263,7 +2263,7 @@ void Foam::conformalVoronoiMesh::reinsertSurfaceConformation()
|
||||
|
||||
const auto iter = oldToNewIndices.cfind(vIndex);
|
||||
|
||||
if (iter.found())
|
||||
if (iter.good())
|
||||
{
|
||||
const label newIndex = *iter;
|
||||
|
||||
|
||||
@ -611,7 +611,7 @@ void Foam::featurePointConformer::reIndexPointPairs
|
||||
|
||||
const auto newIndexIter = oldToNewIndices.cfind(currentIndex);
|
||||
|
||||
if (newIndexIter.found())
|
||||
if (newIndexIter.good())
|
||||
{
|
||||
featurePointVertices_[vI].index() = *newIndexIter;
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ void Foam::pointPairs<Triangulation>::reIndex(const Map<label>& oldToNewIndices)
|
||||
{
|
||||
const auto iter2 = oldToNewIndices.cfind(start.first());
|
||||
|
||||
if (iter2.found())
|
||||
if (iter2.good())
|
||||
{
|
||||
if (iter2() != -1)
|
||||
{
|
||||
@ -210,7 +210,7 @@ void Foam::pointPairs<Triangulation>::reIndex(const Map<label>& oldToNewIndices)
|
||||
{
|
||||
const auto iter2 = oldToNewIndices.cfind(end.first());
|
||||
|
||||
if (iter2.found())
|
||||
if (iter2.good())
|
||||
{
|
||||
if (iter2() != -1)
|
||||
{
|
||||
|
||||
@ -292,11 +292,11 @@ void addToInterface
|
||||
|
||||
auto iter = regionsToSize.find(interface);
|
||||
|
||||
if (iter.found())
|
||||
if (iter.good())
|
||||
{
|
||||
// Check if zone present
|
||||
auto zoneIter = iter().find(zoneID);
|
||||
if (zoneIter.found())
|
||||
if (zoneIter.good())
|
||||
{
|
||||
// Found zone. Increment count.
|
||||
++(*zoneIter);
|
||||
@ -408,7 +408,7 @@ void getInterfaceSizes
|
||||
|
||||
auto masterIter = regionsToSize.find(slaveIter.key());
|
||||
|
||||
if (masterIter.found())
|
||||
if (masterIter.good())
|
||||
{
|
||||
// Same inter-region
|
||||
Map<label>& masterInfo = *masterIter;
|
||||
@ -419,7 +419,7 @@ void getInterfaceSizes
|
||||
const label slaveSize = iter.val();
|
||||
|
||||
auto zoneIter = masterInfo.find(zoneID);
|
||||
if (zoneIter.found())
|
||||
if (zoneIter.good())
|
||||
{
|
||||
*zoneIter += slaveSize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user