mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Simplify checking of container (List/HashTable, strings) sizes
- can use 'XX.empty()' instead of 'XX.size() == 0', 'XX.size() < 1' or 'XX.size() <= 0' or for simpler coding. It also has the same number of characters as '!XX.size()' and /might/ be more readable - many size checking had 'XX.size() > 0', 'XX.size() != 0', or 'XX.size() >= 1' when a simple 'XX.size()' suffices
This commit is contained in:
@ -358,18 +358,21 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
dict.lookup("facesToTriangulate")
|
||||
);
|
||||
|
||||
bool cutBoundary =
|
||||
pointsToMove.size() > 0
|
||||
|| edgesToSplit.size() > 0
|
||||
|| facesToTriangulate.size() > 0;
|
||||
(
|
||||
pointsToMove.size()
|
||||
|| edgesToSplit.size()
|
||||
|| facesToTriangulate.size()
|
||||
);
|
||||
|
||||
List<Pair<point> > edgesToCollapse(dict.lookup("edgesToCollapse"));
|
||||
|
||||
bool collapseEdge = edgesToCollapse.size() > 0;
|
||||
bool collapseEdge = edgesToCollapse.size();
|
||||
|
||||
List<Pair<point> > cellsToPyramidise(dict.lookup("cellsToSplit"));
|
||||
|
||||
bool cellsToSplit = cellsToPyramidise.size() > 0;
|
||||
bool cellsToSplit = cellsToPyramidise.size();
|
||||
|
||||
//List<Tuple<pointField,point> >
|
||||
// cellsToCreate(dict.lookup("cellsToCreate"));
|
||||
@ -523,7 +526,7 @@ int main(int argc, char *argv[])
|
||||
Info<< nl << "There was a problem in one of the inputs in the"
|
||||
<< " dictionary. Not modifying mesh." << endl;
|
||||
}
|
||||
else if (cellToPyrCentre.size() > 0)
|
||||
else if (cellToPyrCentre.size())
|
||||
{
|
||||
Info<< nl << "All input cells located. Modifying mesh." << endl;
|
||||
|
||||
@ -555,7 +558,7 @@ int main(int argc, char *argv[])
|
||||
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
||||
mesh.write();
|
||||
}
|
||||
else if (edgeToPos.size() > 0)
|
||||
else if (edgeToPos.size())
|
||||
{
|
||||
Info<< nl << "All input edges located. Modifying mesh." << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user