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:
@ -878,7 +878,7 @@ void createAndWriteRegion
|
||||
{
|
||||
const polyPatch& pp = newPatches[patchI];
|
||||
|
||||
if (isA<processorPolyPatch>(pp) && pp.size() > 0)
|
||||
if (isA<processorPolyPatch>(pp) && pp.size())
|
||||
{
|
||||
oldToNew[patchI] = newI++;
|
||||
}
|
||||
@ -1049,7 +1049,7 @@ label findCorrespondingZone
|
||||
|
||||
labelList regionCells = findIndices(cellRegion, regionI);
|
||||
|
||||
if (regionCells.size() == 0)
|
||||
if (regionCells.empty())
|
||||
{
|
||||
// My local portion is empty. Maps to any empty cellZone. Mark with
|
||||
// special value which can get overwritten by other processors.
|
||||
@ -1200,7 +1200,7 @@ int main(int argc, char *argv[])
|
||||
boolList blockedFace;
|
||||
|
||||
// Read from faceSet
|
||||
if (blockedFacesName.size() > 0)
|
||||
if (blockedFacesName.size())
|
||||
{
|
||||
faceSet blockedFaceSet(mesh, blockedFacesName);
|
||||
Info<< "Read " << returnReduce(blockedFaceSet.size(), sumOp<label>())
|
||||
|
||||
Reference in New Issue
Block a user