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:
Mark Olesen
2009-01-10 20:28:06 +01:00
parent 16aaf5b54e
commit 95dcb6ded7
211 changed files with 713 additions and 832 deletions

View File

@ -104,7 +104,7 @@ void domainDecomposition::distributeCells()
}
}
if (sameProcFaces.size() > 0)
if (sameProcFaces.size())
{
Info<< "Selected " << sameProcFaces.size()
<< " faces whose owner and neighbour cell should be kept on the"
@ -123,7 +123,7 @@ void domainDecomposition::distributeCells()
*this
);
if (sameProcFaces.size() == 0)
if (sameProcFaces.empty())
{
cellToProc_ = decomposePtr().decompose(cellCentres());
}

View File

@ -100,7 +100,7 @@ int main(int argc, char *argv[])
args
);
if (!timeDirs.size())
if (timeDirs.empty())
{
FatalErrorIn(args.executable())
<< "No times selected"
@ -319,7 +319,7 @@ int main(int argc, char *argv[])
}
if (cloudObjects.size() > 0)
if (cloudObjects.size())
{
// Pass2: reconstruct the cloud
forAllConstIter(HashTable<IOobjectList>, cloudObjects, iter)