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:
@ -118,7 +118,7 @@ Foam::label Foam::blockMesh::numZonedBlocks() const
|
||||
|
||||
forAll(*this, blockI)
|
||||
{
|
||||
if (operator[](blockI).blockDef().zoneName().size() > 0)
|
||||
if (operator[](blockI).blockDef().zoneName().size())
|
||||
{
|
||||
num++;
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ int main(int argc, char *argv[])
|
||||
const labelListList& blockCells = b.cells();
|
||||
const word& zoneName = b.blockDef().zoneName();
|
||||
|
||||
if (zoneName.size() > 0)
|
||||
if (zoneName.size())
|
||||
{
|
||||
HashTable<label>::const_iterator iter = zoneMap.find(zoneName);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Info<< "Creating merge patch pairs" << nl << endl;
|
||||
|
||||
if (mergePatchPairs.size() > 0)
|
||||
if (mergePatchPairs.size())
|
||||
{
|
||||
// Create and add point and face zones and mesh modifiers
|
||||
List<pointZone*> pz(mergePatchPairs.size());
|
||||
|
||||
Reference in New Issue
Block a user