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:
@ -362,7 +362,7 @@ Foam::displacementInterpolationFvMotionSolver::curPoints() const
|
||||
vectorField zoneDisp(displacements_.size(), vector::zero);
|
||||
forAll(zoneDisp, zoneI)
|
||||
{
|
||||
if (times_[zoneI].size() > 0)
|
||||
if (times_[zoneI].size())
|
||||
{
|
||||
zoneDisp[zoneI] = interpolateXY
|
||||
(
|
||||
|
||||
@ -75,7 +75,7 @@ Foam::tmp<Foam::scalarField> Foam::inverseDistanceDiffusivity::y() const
|
||||
|
||||
labelHashSet patchSet(mesh.boundaryMesh().patchSet(patchNames_));
|
||||
|
||||
if (patchSet.size() > 0)
|
||||
if (patchSet.size())
|
||||
{
|
||||
return tmp<scalarField>
|
||||
(
|
||||
|
||||
@ -195,7 +195,7 @@ void surfaceSlipDisplacementPointPatchVectorField::evaluate
|
||||
// Get fixed points (bit of a hack)
|
||||
const pointZone* zonePtr = NULL;
|
||||
|
||||
if (frozenPointsZone_.size() > 0)
|
||||
if (frozenPointsZone_.size())
|
||||
{
|
||||
const pointZoneMesh& pZones = mesh.pointZones();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user