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:
@ -86,7 +86,7 @@ int main(int argc, char *argv[])
|
||||
meshSubsetDict.lookup("zone")
|
||||
);
|
||||
|
||||
if ((markedZone.size() != 0) && (markedZone.size() != 2))
|
||||
if (markedZone.size() && markedZone.size() != 2)
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "zone specification should be two points, min and max of "
|
||||
@ -115,7 +115,7 @@ int main(int argc, char *argv[])
|
||||
// pick up faces connected to "localPoints"
|
||||
//
|
||||
|
||||
if (markedPoints.size() > 0)
|
||||
if (markedPoints.size())
|
||||
{
|
||||
Info << "Found " << markedPoints.size() << " marked point(s)." << endl;
|
||||
|
||||
@ -153,7 +153,7 @@ int main(int argc, char *argv[])
|
||||
// pick up faces connected to "edges"
|
||||
//
|
||||
|
||||
if (markedEdges.size() > 0)
|
||||
if (markedEdges.size())
|
||||
{
|
||||
Info << "Found " << markedEdges.size() << " marked edge(s)." << endl;
|
||||
|
||||
@ -293,7 +293,7 @@ int main(int argc, char *argv[])
|
||||
// Number of additional faces picked up because of addFaceNeighbours
|
||||
label nFaceNeighbours = 0;
|
||||
|
||||
if (markedFaces.size() > 0)
|
||||
if (markedFaces.size())
|
||||
{
|
||||
Info << "Found " << markedFaces.size() << " marked face(s)." << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user